80
rated 0 times
[
81]
[
1]
/ answers: 1 / hits: 15545
/ 11 Years ago, tue, april 16, 2013, 12:00:00
I am newbie to java script and trying to achieve the following and was looking for suggestions:
Create two radio buttons and whenever we select on radio button it should navigate to some URL like in the below example XYZ.com or ABC.com
<html>
<table width=450>
<tr>
<td style=background-color:#FFFFFF;><h4>Choose a Field</h4></td>
</tr>
</table></br>
<form action=../>
<fieldset>
<input type=RADIO value=http://xyz.com name=userChoice id=navRadio01>
<label for=navRadio01>XYZ</label><br>
<input type=RADIO value=http://abc.com name=userChoice id=navRadio02 checked>
<label for=navRadio02>ABC</label><br>
<input type=BUTTON value=Go onclick=ob=this.form.userChoice;for(i=0;i<ob.length;i++){
if(ob[i].checked){window.open(ob[i].value,'_self');};} style=color:#FFFFF;background-color:#E0E0E5;font-family:verdana;border-style:solid; />
</fieldset>
</form>
</html>
I have used the Go button in the above example how can we do this, without using the Go button and once selected navigate to that link.?
Please advice.
Thank you all in advance.
-
V
More From » html