below is my code how do i get the value of all the form elements… if I use console.log() all the elements shoud me printed when a submit button is clicked how to do this… im using MUI
return(
<>
<form method="post" onSubmit={handleSubmit}>
<Card sx={{ maxWidth: 800, minWidth:600 }}>
<CardMedia sx={{ height: 250 }} image={banner} title="green iguana" />
<CardContent>
<Typography gutterBottom variant="h5" component="div" style={{marginBottom:"20px"}}>
<SettingsIcon></SettingsIcon>Notification Settings
</Typography><br />
<TextField
style={{width:"400px",marginBottom:"40px"}}
required
width="600"
id="outlined-required"
label="Whatsapp Number"
defaultValue=""
name='toWhatsappNumber'
/>
<Typography variant="body2" color="text.secondary">
Please Select the Hooks to send notifications
</Typography>
{data.length == 0 ? <p>Loading..</p> : group.map((gkey) => {
return [<Typography gutterBottom variant="h6" marginTop="30px" component="div">{gkey.name}</Typography>,<hr />,
data.map((wkey) => {
if (gkey.id == wkey.group_id) {
// console.log(wkey.hook_name)
return [<div style={{marginLeft: "30px"}}><FormGroup>
<FormControlLabel
control={<Checkbox />} defaultChecked
label={wkey.hook_name}
/>
</FormGroup></div>]
}
})]
})}
</CardContent>
<CardActions style={{justifyContent: 'center'}}>
<Button size="small" variant="contained" onClick={handleSubmit} >save</Button>
{/* <Submit className="button">Save</Submit> */}
</CardActions><br />
</Card>
</form>
</>
)