Hi Long time since I had to look at any javascript I get the error changeAction is not defined please advise?
I basically want to redirect the user to different pages based on the selection of a radiobutton.
javascript:
html:
I basically want to redirect the user to different pages based on the selection of a radiobutton.
javascript:
Code:
<script language="javascript">
function changeAction(eventid) {
if (document.form1.veg1.value == "cabbage") {
window.location = "[URL unfurl="true"]http://www.google.com/";[/URL]
}
if (document.form1.veg1.value == "carrot") {
window.location = "[URL unfurl="true"]http://www.sbs.ox.ac.uk/";[/URL]
}
</script>
html:
Code:
<form name="form1">
cabbage:
<input checked="checked" name="veg1" type="radio" value="cabbage" />
carrot:
<input name="veg1" type="radio" value="carrot" />
<input onclick="javascript:changeAction('a0UQ00000007PwCMAU')" type="button" value="Submit" />
</form>