This commit is contained in:
Dobromir Popov
2024-03-26 01:08:57 +02:00
parent 3fcdfc1347
commit acd776e988
37 changed files with 143 additions and 107 deletions

View File

@ -40,7 +40,7 @@ class ExampleForm extends React.Component {
}
const [item, set] = useState({
isactive: true,
isActive: true,
});
const router = useRouter();
@ -63,7 +63,7 @@ class ExampleForm extends React.Component {
handleChange = ({ target }) => {
if (target.name === "isactive") {
if (target.name === "isActive") {
set({ ...item, [target.name]: target.checked });
} else if (target.name === "age") {
set({ ...item, [target.name]: parseInt(target.value) });
@ -100,8 +100,8 @@ class ExampleForm extends React.Component {
<h3>{router.query?.id ? "Редактирай" : "Създай"} Item </h3>
<div className="mb-4">
<div className="form-check">
<input className="checkbox" type="checkbox" id="isactive" name="isactive" onChange={handleChange} checked={item.isactive} autoComplete="off" />
<label className="label" htmlFor="isactive">
<input className="checkbox" type="checkbox" id="isActive" name="isActive" onChange={handleChange} checked={item.isActive} autoComplete="off" />
<label className="label" htmlFor="isActive">
Is Active</label>
</div>
</div>