SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy How to do Form submission with multiple buttons using javascript - submit()

    Hi All,

    My problem is that I can find a way to sumbit the form using javascript when there are multiple buttons on the form.

    I know that we can do form submission using
    Code:
    form.submit();
    but, I have a different case when I need to sumbit form with javascript but still be able to differentiate which button submits the form (dont get confuse on this. What I am doing is the when a user clicks button, it gets thorught a javascipt that validates and does other job and then submits the form).

    On the other side, I use (php)
    PHP Code:
    if(isset($_REQUEST["Save"])) { } 
    to distinguish b/w two buttons.

    Only thing i need is to find a way to add information about the button tht triggers the form submit().....

    i dont know ... but may be like
    Code:
    form.submit("Save");
    Last edited by harry000; Jul 13, 2006 at 18:02.

  2. #2
    SitePoint Zealot sajjad's Avatar
    Join Date
    May 2005
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for this first u should check which button is clicked
    if(save button is clicked) then use form.submit()
    if(other button is clicked) then use other things


Bookmarks

Posting Permissions

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