简体   繁体   中英

calling submit without a button when checkbox is checked

Is there a way to call "onSubmit" when a checkbox is checked using the html input tag? There is no button.

Regards, rsmitha.

Yes,. Basically you have to call the submit method of the form with Javascript, in a click event for the checkbox

You can add an event on the input tag with some javascript to submit the form.

For example:

<input id="checkBox" type="checkbox" onchange="document['FormName'].submit();">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM