Untitled
const handleFormSand = () => { const form = document.querySelector('form') const nameValue = form?.querySelector('input#gName')?.value const descValue = form?.querySelector('textarea#gDesc')?.value // submit form } return ( <Box as="form" onSubmit={(e) => { e.preventDefault() handleFormSand() }}> <Input name="gName" id="gName" placeholder="L'art de ..." mb={3} /> <Textarea name="gDesc" id="gDesc" rows={6} mb={3} placeholder="Bla bla bla bla bla ..." /> <Button>Enregistrer</Button> </Box> );
Leave a Comment