Hello All,
I'm very new to JavaScript and have run into a problem.
I have a form that has a couple of radio buttons, which make some sections of the form visible or invisible depending on the value of the radio buttons.
The problem is I don’t need to validate fields if they are hidden, but do if they are visible on the form.
I’ve tried this method but have not got it to work:
Any/All help or suggestions with issue would be GREATLY appreciated!
- tm
I'm very new to JavaScript and have run into a problem.
I have a form that has a couple of radio buttons, which make some sections of the form visible or invisible depending on the value of the radio buttons.
The problem is I don’t need to validate fields if they are hidden, but do if they are visible on the form.
I’ve tried this method but have not got it to work:
Code:
var MyForm = document.forms["Form2"];
if(MyForm.Field1.value == "Yes")
{
function DoRequestType()
{
var frm = document.forms["Form2"];
if(frm.Field1.value == "Yes" && frm.Field2.value == "")
{
alert('This is a required field.');
return false;
}
else
{
return true;
}
Any/All help or suggestions with issue would be GREATLY appreciated!
- tm