Radio Button Chooses New URL

[Total: 0    Average: 0/5]

This shows how to use a radio button selection to redirect the web browser.

Head Code:

function redirect(oform){
var href=null
for (var i=0;i<oform.rdoption.length;i++)
{ if (oform.rdoption[i].checked)
if (href !=null)
return false


Body Code:

<form onsubmit='return redirect(this)'>
<input type='radio' name=rdoption value= '/'> JS-E Home Page
<input type='radio' name=rdoption value= '/example/'> JavaScript Page
<input type='radio' name=rdoption value ='/asp/'> ASP Page
<input type=submit>

Times Viewed: 5

Leave a Reply

Your email address will not be published. Required fields are marked *