Opening another page based on text box contents

P

Peter

I have a text box and a command button. I'd like the user to enter some txt,
click on the button, and depending upon the value in the text box, open one
of several pages. Any simple ways to do this using vbscript or other methods
?
 
P

p c

There are different ways. Here's one method.

If you have pre-determined choices, it is better to use a radio or a
drop down box with form field values corresponding to triggers for your
choices. This way you eliminate the possibility for invalid input. You
can use a text box but then you will have to deal with invalid input.

Anyway, here's the pseudo code

--in the form page: say, gotoPageForm.html
<form method="POST" action="myformResponse.asp">
<p><input type="text" name="page" size="20"></p>

--In the response page: say, myformResponse.asp
<%
strPage= Request.Form("page")
Select Case strOption
Case "p1"
response.redirect ("page1.html")
Case "p2"
response.redirect ("page3.html")
....
Case Else
response.write ("<br>Note: No page available for that selection")
End Select
%>


Regards,
...PC
 
M

MD Websunlimited

Hi Peter,

How do you know what the user will enter? If you do know then use a drop down selection box with a JavaScript jump.
 

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

Top