scripting for a button to goto page ?

P

paul814

I've got a page that has a form on it, the form has radio buttons and
a option box selection. It also has a continue button.

I want to be able to take my users to a different page after the
continue is pressed based on what they selected in the radio buttons
and the option groups.

for example:
if they select radio button radwrite and option item lsteditorial goto
page1.php

if they select radio button radwrite and option box lstpres goto
page2.php etc...etc...

What would be a way to code for the button to accomplish this?

here is my code so far:
=====
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Production Report</title><style type="text/css">
<!--
..style2 {font-size: 24px}
..style5 {font-size: 18px}
-->
</style></head>

<body>
<center>
<p><img src="http://info/test/etnlogored2.gif" width="199"
height="30" /></p>
<p>&nbsp;</p>
<p><em><strong><span class="style2">What would you like to do?:</
span></strong></em></p>
<form id="form1" name="form1" method="post" action="select.php">
<p>
<label>
<input type="radio" name="radReadWrite" value="1"
id="radReadWrite_0" />
<span class="style5">Write Report</span></label>
<br />
<label>
<input type="radio" name="radReadWrite" value="2"
id="radReadWrite_1" />
<span class="style5">View Report</span></label>
</p>
<p><em><strong><span class="style2">Please also select the
department:</span></strong></em></p>
<p>
<select name="lstdepartment" id="lstdepartment">
<option value="lstEditorial">Editorial</option>
<option value="lstPrepress">Pre Press</option>
<option value="lstInformationTechnology">Information
Technology</option>
<option value="lstPres">Press</option>
<option value="lstMailroom">Mail Room</option>
<option value="lstCirculation">Circulation</option>
</select>
</p>
<p>
<input type="submit" name="btnSubmit" id="btnSubmit"
value="Continue" />
<br />
</p>
</form>
</center>

</body>
</html>
 
D

Darko

I've got a page that has a form on it, the form has radio buttons and
a option box selection. It also has a continue button.

I want to be able to take my users to a different page after the
continue is pressed based on what they selected in the radio buttons
and the option groups.

for example:
if they select radio button radwrite and option item lsteditorial goto
page1.php

if they select radio button radwrite and option box lstpres goto
page2.php etc...etc...

What would be a way to code for the button to accomplish this?

here is my code so far:
=====
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Production Report</title><style type="text/css">
<!--
.style2 {font-size: 24px}
.style5 {font-size: 18px}
-->
</style></head>

<body>
<center>
<p><img src="http://info/test/etnlogored2.gif" width="199"
height="30" /></p>
<p>&nbsp;</p>
<p><em><strong><span class="style2">What would you like to do?:</
span></strong></em></p>
<form id="form1" name="form1" method="post" action="select.php">
<p>
<label>
<input type="radio" name="radReadWrite" value="1"
id="radReadWrite_0" />
<span class="style5">Write Report</span></label>
<br />
<label>
<input type="radio" name="radReadWrite" value="2"
id="radReadWrite_1" />
<span class="style5">View Report</span></label>
</p>
<p><em><strong><span class="style2">Please also select the
department:</span></strong></em></p>
<p>
<select name="lstdepartment" id="lstdepartment">
<option value="lstEditorial">Editorial</option>
<option value="lstPrepress">Pre Press</option>
<option value="lstInformationTechnology">Information
Technology</option>
<option value="lstPres">Press</option>
<option value="lstMailroom">Mail Room</option>
<option value="lstCirculation">Circulation</option>
</select>
</p>
<p>
<input type="submit" name="btnSubmit" id="btnSubmit"
value="Continue" />
<br />
</p>
</form>
</center>

</body>
</html>

Try using window.location to take users from the page, and
document.getElementById( "optionMenuId" ).value, selectedValue or what
was
that word precicely, or something.

Search google anyways, it's got PLENTY of information on such basic
things.

Darko
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top