Form - radio button decides destination

  • Thread starter Thread starter Jackie
  • Start date Start date
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
 
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.
==============================================
 
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.
==============================================
 
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"
 
Back
Top