Multiple Submit Actions (Using Images) within the

javascript United States
  • 19 years ago

    I'm trying to pass an username and password saved in hidden fields to the next asp page.  The problem is that in my form, I have three different images used for my submit "buttons" and I'm trying to direct the user to a different page depending on which image is chosen.  The following code seems to work in Internet Explorer but nothing happens in Netscape 4.x
    Could you provide some insight as to why the different "actions" will not work in Netscape?


    PS -- I know that setting up three different forms with the different actions will work, but it seems a little excessive to have to use three different forms repeating the hidden fields within each.


    Thanks for your help,
    Brian



    Problem Code:


    <FORM NAME="myForm" METHOD="POST">


    <INPUT TYPE="Hidden" NAME="Username" VALUE="<%=myUserName%>">
    <INPUT TYPE="Hidden" NAME="Password" VALUE="<%=myPassword%>">


    <INPUT TYPE="IMAGE" SRC="Images/Buttons/Go.gif" onclick="javascript:document.myForm.action=’ASP1.asp’; document.myForm.submit(); return true;">ASP1<BR>


    <INPUT TYPE="IMAGE" SRC="Images/Buttons/Go.gif" onclick="javascript:document.myForm.action=’ASP2.asp’; document.myForm.submit(); return true;">ASP2<BR>


    <INPUT TYPE="IMAGE" SRC="Images/Buttons/Go.gif" onclick="javascript:document.myForm.action=’ASP3.asp’; document.myForm.submit(); return true;">ASP3<BR>


    </FORM>

  • 19 years ago

    hi
    u seemto have posted this question in both sections...


    get the code onthis site itself...


    right on the first page... www.developerfusion.com
    In the - Latest Code Section -  check the follwoing article
    Multiple Submit Buttons (JavaScript)


    making images as such to be submit buttons is not at all tough.. its the same as normal buttons.. just remember to put button type=image


    -kiran

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill