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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple problem

Status
Not open for further replies.

daka94

Programmer
Apr 27, 2001
33
US
Hai,
i had two radio buttons.i would like to open jsp page depending upon selection of radio button.i.e i had two jsp pages.depending upon selelction i have to open one page from those two.How can i do this.if possible please give an simple ex.
please help me
thank u in advance
 
here you go maybe this should help

<html>
<head>

<script language=&quot;JavaScript&quot;><!--
function go(what) {
for (var i=0; i<3; i++) {
if (what.sameName.checked == true)
location.href = what.sameName.value;
}
}
//--></script>

</head>

<body>

<form>
<br><input type=&quot;radio&quot; name=&quot;sameName&quot; value=&quot; JavaScript FAQ
<br><input type=&quot;radio&quot; name=&quot;sameName&quot; value=&quot; JavaScript Articles
<br><input type=&quot;radio&quot; name=&quot;sameName&quot; value=&quot; JavaScript Games

<p>

<input type=&quot;button&quot; onClick=&quot;go(this.form)&quot; value=&quot;Go&quot;>
</form>

</body>

;-)
 
You can also do it this way:

<script>
function openit() {

if (form1.choice[0].checked) {
window.open('nopage.html');
}
else {
window.location.href=&quot;yourpage.jsp&quot;;
}
}

</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot; onClick=&quot;openit()&quot; >
<table width=&quot;165&quot; border=&quot;0&quot;>
<tr>
<td width=&quot;80&quot;>
<input type=&quot;radio&quot; name=&quot;choice&quot; value=&quot;choice&quot;>
Enter</td>
<td width=&quot;75&quot;>
<input type=&quot;radio&quot; name=&quot;choice&quot; value=&quot;choice&quot;>
Leave</td>
</tr>
</table>
</form>
</body>
</html>
I have not failed; I merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top