Hi,
Wondering if you can direct me on how to start this. This is an event registration form. If someone clicks Yes I will attend (radio button), then they should proceed to fill out the form (and this form should be validated onsubmit). The other option is for them to click No (radio button), I will not attend. If they choose this, then they should be able to submit without having to complete the form.
I have this code so far, and while I don't get an error on the page, the page does allow me to submit the form without filling out the mandatory fields when the radio button is checked. So something (lots probably) is missing. Help!
- Code: Select all
function check_radio ()
if (document.getElementById('radio1').checked == true)
{
function validate_form ()
{
if ( document.reg_form.vorname.value == "" ){
alert ( "Geben Sie bitte Ihren Vornamen ein" );
document.reg_form.vorname.focus();
document.reg_form.vorname.select();
return false;
}
if ( document.reg_form.nachname.value == "" ){
alert ( "Geben Sie bitte Ihren Nachnamen ein" );
document.reg_form.nachname.focus();
document.reg_form.nachname.select();
return false;
}
}
}
}