Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Multiple submit buttons
matbeard
Junior Member

Posts: 4
Registered: 2/20/2006
Member Is Offline
posted on 2/20/2006 at 03:52 PM Reply With Quote
Multiple submit buttons


I'm trying to use the Form Validator on a page with multiple submit buttons.

I'd like to have different sets of validation depending on which button is used to submit the form.

Can anyone work out how this would be possible?

Thanks.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 2/20/2006 at 05:21 PM Reply With Quote

you'll have to call the validation from onclick event of the button, instead of onsubmit event of the form. Create multiple validator objects and call exec() on the one you want to use.
View User's Profile View All Posts By User U2U Member
matbeard
Junior Member

Posts: 4
Registered: 2/20/2006
Member Is Offline
posted on 2/20/2006 at 05:35 PM Reply With Quote
I thought about that but...


...a javascript 'return true' or 'return false' has no effect on a submit button's action... it submits the form regardless.

So adding onclick="return v.exec()" to the button doesn't validate the form at all -- it's just submitted.

Unless I've completely missed the point, that is... :-)
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 2/20/2006 at 07:11 PM Reply With Quote

I tried
Code:


<form action="http://www.softcomplex.com/">
<input type="Submit" value="submit 1" onclick="return false">
<input type="Submit" value="submit 2" onclick="return false">
</form>



neither button submitted the form
View User's Profile View All Posts By User U2U Member
matbeard
Junior Member

Posts: 4
Registered: 2/20/2006
Member Is Offline
posted on 2/21/2006 at 09:28 AM Reply With Quote
Hmmm...


...really? I've have to investigate that further. It didn't seem to work when I tried.

I must have done something wrong.

Thanks for the advice.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Product Page
Product Demonstrations Product Demos
Registration Form Validation
Login Form Validation
Free Download Free Download
Product Documentation Documentation
Documenation Page
Change Log
Validators Comparison Table
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004