Form - radio button decides destination

J

Jackie

Hi,

Can anyone tell me how to use the value of a radio button to decide which
page a form should return its results to?

I have a form with many hidden fields carried forward from a log-in page.
Other than those, the form contains only 3 radio buttons, enabling the user
to choose to insert, amend or delete a database record.

I've been trying to set up the form action dependant upon the value of the
radio button, but it's returning a blank value. What am I doing wrong?

<form METHOD="POST" action="<%=request.form("gotopage")%>.asp?partnerid=<%
=partnerid %>" name="form">

Insert new hotel&nbsp;<input type="radio" value="newhotel" checked
name="gotopage"></p>
Amend existing hotel&nbsp;&nbsp;&nbsp;<input type="radio" name="gotopage"
value="yourhotels"></p>
Delete existing hotel&nbsp;&nbsp;&nbsp;<input type="radio" name="gotopage"
value="deletehotels"></p>

<input type="submit" value="Submit" name="B1">

Many thanks,

Jackie
 
T

Thomas A. Rowe

You need to post the form to a page that takes the value of gotopage and
then redirect to that page along with the other value, which could be
written into session object,

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
J

Jackie

Thanks Thomas. I'll give it a whirl.

Jackie


Thomas A. Rowe said:
You need to post the form to a page that takes the value of gotopage and
then redirect to that page along with the other value, which could be
written into session object,

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
M

MD WebsUnlimited.com

Hi Jackie,

Assuming that there is a correspondence between the radio button and page
you would use the following script:

server.redirect request.form("gotopage") & ".htm"
 

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