Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    java script onSubmit event

    I have an html form with three submit buttons on, when I click a submit button I call a javascript
    function to validate the form. The problem is that I want to distinguish which of the three submit buttons was clicked. Is there any way to accomplish this?

    Many Thanks
    Roger.

  2. #2
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: java script onSubmit event

    Doesn't matter, i've figured it out now :-)

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: java script onSubmit event

    Care to share your solution?

  4. #4
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: java script onSubmit event

    Sorry about that. My solution is as follows:

    In the onclick event of each button, I call a JS function, passing in the button name as a string, eg.
    <input type=submit value="Save" onclick="return Validate('cmdSave') "name="cmdSave">
    then in my Validate(myCmd) function I perform the error checking and return either true or false. Returning false cancels the button click and the form is not submitted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •