indigoblue
Programmer
Hi am trying to code a page where a user selects a radio box and depending on what option is selected, the user is redirected to another page, with certain values that depend on what is selected posted to the next page. The html goes like this:
<form name="form1" action="pagex.htm" onSubmit="return transvar(this)">
<input type="radio" value="r0" name="mselect"></p>
<input type="radio" value="r1" name="mselect"></p>
<input type="hidden" name="var1">
<input type="hidden" name="var2">
<input type="submit" name="Submit" value="Submit">
</form>
and the transvar code I've written as follows:
function transvar(form)
{
if(form.mselect[0].checked == true)
{
form.var1.value = "xxx";
form.var2.value = "yyy";
return true;
}
else if(form.mselect[1].checked == true)
{
form.var1.value = "zzz";
form.var2.value = "aaa";
return true;
}
......
}
but, whenever I click submit I get an "object expected" error message.
Has anyone got any ideas?
Cheers,
Paul [sig][/sig]
<form name="form1" action="pagex.htm" onSubmit="return transvar(this)">
<input type="radio" value="r0" name="mselect"></p>
<input type="radio" value="r1" name="mselect"></p>
<input type="hidden" name="var1">
<input type="hidden" name="var2">
<input type="submit" name="Submit" value="Submit">
</form>
and the transvar code I've written as follows:
function transvar(form)
{
if(form.mselect[0].checked == true)
{
form.var1.value = "xxx";
form.var2.value = "yyy";
return true;
}
else if(form.mselect[1].checked == true)
{
form.var1.value = "zzz";
form.var2.value = "aaa";
return true;
}
......
}
but, whenever I click submit I get an "object expected" error message.
Has anyone got any ideas?
Cheers,
Paul [sig][/sig]