Page with 2 forms on ??

P

Poppy

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
 
E

Evertjan.

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.
 
R

Ray at

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top