Page with 2 forms on ??

Discussion in 'ASP General' started by Poppy, Feb 9, 2004.

  1. Poppy

    Poppy Guest

    If I have 2 forms on a page "form1" & "form2", is there a way to figure out
    which form has in fact been submitted ?

    Thanks in Advance
    Poppy, Feb 9, 2004
    #1
    1. Advertising

  2. Poppy

    Evertjan. Guest

    Poppy wrote on 09 feb 2004 in microsoft.public.inetserver.asp.general:
    > If I have 2 forms on a page "form1" & "form2", is there a way to
    > figure out which form has in fact been submitted ?


    name the submit button or add a hidden input

    in fact off topic, clientside issue.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 9, 2004
    #2
    1. Advertising

  3. Poppy

    Ray at Guest

    I don't think this is a client-side issue.

    Go with the hidden input. If you use different submit buttons, you won't be
    able to tell which form it is when a user submits with Enter or Ctrl+M.

    <form action="page.asp" method="post">
    <input type="hidden" name="whichForm" value="1">
    < rest of form>
    </form>


    <form action="page.asp" method="post">
    <input type="hidden" name="whichForm" value="2">
    < rest of form>
    </form>


    <%
    Select Case Request.Form("whichForm")
    Case "1"
    Response.Write "Form 1 was submitted"
    Case "2"
    Response.Write "Form 2 was submitted"
    End Select
    %>

    Ray at work

    "Evertjan." <> wrote in message
    news:Xns948A6C76F2600eejj99@194.109.133.29...
    > Poppy wrote on 09 feb 2004 in microsoft.public.inetserver.asp.general:
    > > If I have 2 forms on a page "form1" & "form2", is there a way to
    > > figure out which form has in fact been submitted ?

    >
    > name the submit button or add a hidden input
    >
    > in fact off topic, clientside issue.
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
    Ray at, Feb 9, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Miller

    Web Forms VS Windows Forms

    Brendan Miller, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,055
    Kevin Spencer
    Aug 11, 2003
  2. Eric
    Replies:
    2
    Views:
    1,383
    Tommy
    Feb 13, 2004
  3. jlopes151
    Replies:
    2
    Views:
    602
    Steve C. Orr [MVP, MCSD]
    Mar 14, 2005
  4. =?Utf-8?B?ZGF2aWQ=?=

    embedded windows forms into web forms for control

    =?Utf-8?B?ZGF2aWQ=?=, Apr 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,196
    =?Utf-8?B?ZGF2aWQ=?=
    Apr 10, 2005
  5. Eric
    Replies:
    2
    Views:
    459
Loading...

Share This Page