Mozie
10-13-2008, 10:47 AM
If I have two text fields Box1 and Box2, and I want to make one of them required. So, if no value is filled in for Box1 then a value is required in Box2. And, if Box1 has been filled in, then Box2 cannot be filled in. I am using the following validation:
<script LANGUAGE="JavaScript">
function ValidateFld(){
if (document.frmDetails.UserName.value=='')
{
alert('Please enter a value for the Name field.');
return;
}
if (document.frmDetails.email.value=='')
{
alert('Please enter a valid e-mail address.');
return;
}
document.frmDetails.submit();
}
</script>
How can I acomplish this?
Thanks in advance
<script LANGUAGE="JavaScript">
function ValidateFld(){
if (document.frmDetails.UserName.value=='')
{
alert('Please enter a value for the Name field.');
return;
}
if (document.frmDetails.email.value=='')
{
alert('Please enter a valid e-mail address.');
return;
}
document.frmDetails.submit();
}
</script>
How can I acomplish this?
Thanks in advance