I have difficulty to solve this and would ask your help !
I’m trying to make a javascript but i had no success
i have inside a form below, two input checkbox, when the user press the submit
i want to verify if the two checkbox is checked, if they are checked i want to
disable the two before sending it to another page,
and if only one of then is checked, i want to do nothing.
<form action="{$GLOBALS.site_url}/search/">
<input type="checkbox" checked = "checked" name="new[equal]" value="1" /> New <br>
<input type="checkbox" checked = "checked" name="used[equal]" value="1" /> Used <br>
<input type="submit" class="button" value="[[Find:raw]]" />
</form>
thank you friends
You can try this.
If you have multiple forms on the page then you should provide a
nameto theformand use the form name to select the required form.Something like this will do.
document.formName.elementNameordocument.formName['elementName']Update:
If you want to validate this on submit button click then you can create a JS function with above code and call it on submit button click
HTML
JS