bobrivers2003
Technical User
HI,
I have a simple form consisting of two radio buttons. When a radio button is clicked the user is redirected to a given url.
Javascript:
function radio_input(url)
{
// Re-direct the browser to the url value
window.location.href = + url
}
Form:
<form id="form" method="get">
<input type="radio" name="group1" value="off" onClick="JavaScript:radio_input('<input type="radio" name="group1" value="off" onClick="JavaScript:radio_input('</form>
As you can see in the onClick"" you have to put the entire url as an argument. I want to just put the particular page (i.e JavaScript:radio_input('page2.php')
I tried removing the href from the javascript but just get an NaN error.
Any suggestions would be greatly appreciated.
Thanks and Regards
I have a simple form consisting of two radio buttons. When a radio button is clicked the user is redirected to a given url.
Javascript:
function radio_input(url)
{
// Re-direct the browser to the url value
window.location.href = + url
}
Form:
<form id="form" method="get">
<input type="radio" name="group1" value="off" onClick="JavaScript:radio_input('<input type="radio" name="group1" value="off" onClick="JavaScript:radio_input('</form>
As you can see in the onClick"" you have to put the entire url as an argument. I want to just put the particular page (i.e JavaScript:radio_input('page2.php')
I tried removing the href from the javascript but just get an NaN error.
Any suggestions would be greatly appreciated.
Thanks and Regards