36 users online (1 members and 35 guests)  


  Results 1 to 1 of 1

Related

  1. Replies: 2
  2. javascript in html    Forum: HTML Forum
    Replies: 6
  3. javascript should be displayed in html    Forum: HTML Forum
    Replies: 0
  4. Replies: 7
  1. #1
    john77's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2004
    Posts
    1

    multiple submit buttons problem...

    Hi,

    I'm trying to use a multiple submit buttons on my html form.

    I am trying to create a "Next" and "Finish" buttons.

    "Next"- will run action="file1.asp"

    "Finish"- will run action="file2.asp"

    (before executing the files I am running a valid check of the form using a JS code).

    I also have another submit button "GO" that calls action="my_asp_page.asp" inorder to show data on the form from an Access DB.

    It doesn't work!!!!!!

    for some reason the "GO" button works, but I just can't make

    the "Next" and "Finish" buttons to call the required asp files???
    ...


    I'm attaching the relevant code:

    The JS relevant code:


    //this function validates the form and decides what to do next
    function action()
    {
    if(document.pressed == 'Next' ||
    document.pressed == 'Finish')
    {
    if(applianceVal())
    document.NewApp.action= "handleAppliance.asp"
    else document.NewApp.action ="";
    }
    else
    if(document.pressed == 'GO')
    {
    document.NewApp.action = "Appliance.asp";
    }
    //document.NewApp.submit();
    return true;
    }



    The form tag:

    <form id="my" name="NewApp" method="post" action="" onSubmit="return action()">


    The "GO" button tag:

    <input type="submit" name="submit" value="GO" onClick="document.pressed=this.value">


    The "Next" button tag:

    <input type="submit" name="submit" value="Next" style="width:70px; height:35px; vertical-align:middle; color:#000099; font-weight:bold;" onClick="document.pressed=this.value">


    The "Finish" button tag:

    <input type="submit" name="submit" value="Finish" style="width:70px; height:35px; vertical-align:middle; color:#000099; font-weight:bold;" onClick="document.pressed=this.value">

    Please help...
    Last edited by john77; 08-07-2004 at 11:49 AM.