Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically determine which form to display on 1 page.

Status
Not open for further replies.

rvproductions2000

Programmer
Apr 9, 2008
1
US
I am trying to write a page similar as you would use Panels in .NET. I am writing this in classic asp. Basically there are 2 form in 1 page. When the page loads it shows form 1. When the submit button is press the second form would display.

I need to write the code to enable the above feature as I can not use Response.Redirect.

Thx,
 
Give the submit button a name and then check the browser's HTTP request to see if it was submitted because every form element with a name will be submitted along with the form.
Code:
<% If Request("btnSubmit") <> "" Then %>
  Thanks for submitting the form.  Yo!
  <br>
  And in the nice box you typed: <%= Request("foo")%>
<% Else %>
  <form method="post">
    This is a nice box: <input type="text" name="foo">
    <br>
    <input type="submit" name="btnSubmit" value="Test">
  </form>
<% End If %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top