Skip to content

Commit

Permalink
Merge pull request #813 from gitmedha/issue/sis-135
Browse files Browse the repository at this point in the history
Checkbox
  • Loading branch information
Medha-Admin authored Apr 16, 2024
2 parents 526ce7c + 312ab08 commit afb69c9
Showing 1 changed file with 32 additions and 39 deletions.
71 changes: 32 additions & 39 deletions src/views/Students/StudentComponents/CheckBoxForm.jsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
import React, { useEffect } from 'react'
import React from 'react';

const CheckBoxForm = (props) => {


const handleChange = (event,key) => {
if(event.target.checked && key=="massEdit"){
props.setMassEditCheck(true);
props.setBulkAddCheck(false)
}else{
props.setBulkAddCheck(true)
}
const handleBulkChange = () => {
props.setBulkAddCheck(true);
props.setMassEditCheck(false);
};

const handleBulkChange = (event,key) => {
if(event.target.checked && key=="bulk"){
props.setBulkAddCheck(true);
props.setMassEditCheck(false)
}else{
props.setMassEditCheck(true)

}
const handleMassEditChange = () => {
props.setBulkAddCheck(false);
props.setMassEditCheck(true);
};





return (
<>
<div className="d-flex">
<div className="mr-3">
<input type="checkbox" id="scales" name="scales" checked={props.bulkcheck} onChange={(e)=>handleBulkChange(e,'bulk')} />
<label for="scales">{props.bulkAdd}</label>
</div>

<div className="ml-3">
<input type="checkbox" id="scales" name="scales" checked={props.masscheck} onChange={(e)=>handleChange(e,"massEdit")} />
<label for="scales">{props.massEdit} </label>
</div>
</div>
</>
)
}
<div className="d-flex">
<div className="mr-3">
<input
type="radio"
id="bulk"
name="option"
checked={props.bulkcheck}
onChange={handleBulkChange}
/>
<label htmlFor="bulk">{props.bulkAdd}</label>
</div>

<div className="ml-3">
<input
type="radio"
id="massEdit"
name="option"
checked={!props.bulkcheck}
onChange={handleMassEditChange}
/>
<label htmlFor="massEdit">{props.massEdit}</label>
</div>
</div>
);
};

export default CheckBoxForm;


0 comments on commit afb69c9

Please sign in to comment.