Link to home
Start Free TrialLog in
Avatar of FairyBusiness
FairyBusinessFlag for United States of America

asked on

How to find out which submit button was clicked when you have multiple submit buttons?

Hi, I have a form with 3 submit buttons.  I need to know which one was clicked though, so that my form validation function knows which part of the form to validate.  Does anyone know how to determine which submit button as clicked in a form?
ASKER CERTIFIED SOLUTION
Avatar of mrh14852
mrh14852

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FairyBusiness

ASKER

Does this work for submitting a form though? I have .submit not .click.

    $("userForm").submit(function () {

Open in new window

correction, I have this in my code:

$("#userForm").submit(function () {

Open in new window

Avatar of mrh14852
mrh14852

Well you said you had multiple buttons.

Can you post your full form code please.
I've requested that this question be closed as follows:

Accepted answer: 0 points for FairyBusiness's comment http:/Q_27521990.html#37383361

for the following reason:

I got it working, thanks.<br />I just put the .submit function inside of the .click function.
I didn't mean to delete this question. I wanted to accept a solution.