M
Meredith
I am using a script to validate a form using the presence of a value in
one field and determine if there is a value in one of two fields. It
is an either/or situation. If the date rcvd field is not "", then
either the ref names has to be filled in OR the res date has to be
filled in. I have tried many combinations of this. Any suggestions
will be greatly appreciated.
<script language="JavaScript">
function ValidateForm(){
var Rcv1Field = document.form1.DateRcvd
var Refer1Field = document.form1.RefNames
var FRDfield = document.form1.ResDate
if (Rcv1Field.value != "" && (Refer1Field.value == "" || FRDfield.value
!= "")){
if (Rcv1Field.value != "" && Refer1Field.value == "" ){
alert("Please Enter a Referral")
Refer1Field.focus()
return false
}
if (Rcv1Field.value != "" && FRDfield.value != ""){
alert("Please Enter a Final Resolution Date")
FRDfield.focus()
return false
}
}
return true
}
</script>
one field and determine if there is a value in one of two fields. It
is an either/or situation. If the date rcvd field is not "", then
either the ref names has to be filled in OR the res date has to be
filled in. I have tried many combinations of this. Any suggestions
will be greatly appreciated.
<script language="JavaScript">
function ValidateForm(){
var Rcv1Field = document.form1.DateRcvd
var Refer1Field = document.form1.RefNames
var FRDfield = document.form1.ResDate
if (Rcv1Field.value != "" && (Refer1Field.value == "" || FRDfield.value
!= "")){
if (Rcv1Field.value != "" && Refer1Field.value == "" ){
alert("Please Enter a Referral")
Refer1Field.focus()
return false
}
if (Rcv1Field.value != "" && FRDfield.value != ""){
alert("Please Enter a Final Resolution Date")
FRDfield.focus()
return false
}
}
return true
}
</script>