I have a form,
It has multiple submit buttons (Save/Quit)
I want my form calidation to run when I save and not when I quit.
I still want to submit the form when I quit.
So how do I conditionally run the validation?
Ta,
| SitePoint Sponsor |




I have a form,
It has multiple submit buttons (Save/Quit)
I want my form calidation to run when I save and not when I quit.
I still want to submit the form when I quit.
So how do I conditionally run the validation?
Ta,
If you aren't living life on the edge
- you're taking up too much space
Creative Dreaming Ltd / Ask The Local / Amanzi Travel
<input type="button" value="Save" onclick="if( validateForm() ) this.form.submit();">
<input type="submit" value="Quit" />




Cool - that almost worked. The only problem with that is, it doesn't post the button value with the form. Is that something to do with calling submit manually? Anyway as it turned out the following worked just fine.Originally posted by beetle
<input type="button" value="Save" onclick="if( validateForm() ) this.form.submit();">
<input type="submit" value="Quit" />
<input type="button" value="Save" onClick=" return validateForm(this.form);">
If you aren't living life on the edge
- you're taking up too much space
Creative Dreaming Ltd / Ask The Local / Amanzi Travel
Bookmarks