Form Submit
1 posts in topic
Flat View  Flat View

Posted By:   Aaron_Keane
Posted On:   Friday, September 7, 2001 06:46 AM

I am trying to validate a form before submitting it. Essentially I am checking to see if at least one of the checkboxes has been ticked. If it has not been ticked I want to display an alert which points this fact out.

The one thing that I am having issue with is owing to the action on my form and the fact that I am calling my validation function fromthe submit button, the user is brought through to the next page regardless of whether or not they have selected a checkbox or not.

I suppose that what I am really wondering is how to make the submit bomb out if certain criteria have not been met.

if anyone can offer any assistance it would be great

Re: Form Submit

Posted By:   Sean_Ruff  
Posted On:   Friday, September 7, 2001 10:26 AM

You need to change the submit button to to a normal button and add an onClick handler to the button as such:

Then in your validation script if all of the criteria is met, use the form.submit(); as such: