travisbrown
Technical User
- Dec 31, 2001
- 1,016
When a user clicks submit and a checkbox isn't checked, the page executes the apert below. Problem is, form still submits when you "ok" the alert. How do only submit the form when the checkbox is checked?
exexuted from onsubmit.
Code:
function checklegal() {
if( !document.forms.legal.agree.checked ) {
alert("Please agree to continue");
}
};
exexuted from onsubmit.