C
canajien
How do I keep the form from resetting itself after the validation
check has found a missing field? Every time a missing field is found
and you click ok to go to the missing item it reset all the
information
my validation code is follows:
function validateForm(form)
{
// check name
if (""==document.forms.form.name.value)
{
alert ("Please enter a name!");
document.forms.form.name.focus();
return false;
}
// beach_visited
if (!document.forms.form.beach_visited_0.checked &&
!document.forms.form.beach_visited_1.checked &&
!document.forms.form.beach_visited_2.checked) {
// no radio button is selected
alert ("Please select a beach!");
document.forms.Beach_Control.beach_visited.focus();
return false;
}
// check month
if ( document.forms.form.Month.selectedIndex == 0 )
{
alert ( "Please select the month." );
document.forms.form.Month.focus();
valid = false;
}
}
what am I missing here?
Thanks
check has found a missing field? Every time a missing field is found
and you click ok to go to the missing item it reset all the
information
my validation code is follows:
function validateForm(form)
{
// check name
if (""==document.forms.form.name.value)
{
alert ("Please enter a name!");
document.forms.form.name.focus();
return false;
}
// beach_visited
if (!document.forms.form.beach_visited_0.checked &&
!document.forms.form.beach_visited_1.checked &&
!document.forms.form.beach_visited_2.checked) {
// no radio button is selected
alert ("Please select a beach!");
document.forms.Beach_Control.beach_visited.focus();
return false;
}
// check month
if ( document.forms.form.Month.selectedIndex == 0 )
{
alert ( "Please select the month." );
document.forms.form.Month.focus();
valid = false;
}
}
what am I missing here?
Thanks