I've created a form and used formcheck to ensure that users enter the required fields. This works fine for text fields, but it doesn't seem to work for the radiobuttons.
I assume it's something very simple that I'm doing wrong.
This is the section of the javascript that isn't working:
<script language="javascript">
<!--
function formCheck()
{
if (document.theform.RadioGroup1.value == "")
{
alert("Please select an answer.");
document.theform.RadioGroup1.focus();
return false;
}
and this is the piece of the form it refers to:
<label>
<input type="radio" name="RadioGroup1" value="Sydney">
Sydney</label>
<label>
<input type="radio" name="RadioGroup1" value="Melbourne">
Melbourne</label>
<label>
<input type="radio" name="RadioGroup1" value="Brisbane">
Brisbane</label>
Could anyone point me in the right direction?
I assume it's something very simple that I'm doing wrong.
This is the section of the javascript that isn't working:
<script language="javascript">
<!--
function formCheck()
{
if (document.theform.RadioGroup1.value == "")
{
alert("Please select an answer.");
document.theform.RadioGroup1.focus();
return false;
}
and this is the piece of the form it refers to:
<label>
<input type="radio" name="RadioGroup1" value="Sydney">
Sydney</label>
<label>
<input type="radio" name="RadioGroup1" value="Melbourne">
Melbourne</label>
<label>
<input type="radio" name="RadioGroup1" value="Brisbane">
Brisbane</label>
Could anyone point me in the right direction?