J
jr
The psuedocode is
1. if "search_bu" is empty
then return false because it is a required field
2. if "search_zoneid has a value
then if search_zonenm is empty return false
3 OR the reverse of 2
if "search_zonenm has a value
then if search_zoneid is emtpy return false
I think what it is doing know is working on all 3 but if I don't input
either a zoneid or zonenm it still asks for the zonenumber?????
It may be number 2 and 3 need to be an OR someway? The problem is
zoneid or zonenm are not rquired but it is acting like they are
required.
They are only required if one of those fields has a value.
thanks,
JanisR
function checkscript() {
if (document.forms[0].search_bu.value == '' ||
document.forms[0].search_bu.value== null ) {
// something else is wrong
alert('The Business Unit is a required field!');
return false;
}
else if (document.forms[0].search_zoneid.value != '' ||
document.forms[0].search_zoneid.value!=null) {
if (document.forms[0].search_zonenm.value == '' ||
document.forms[0].search_zonenm.value==null ){
alert('You must input the zone number if you search on
zone id!');
return false;
}
}
else if (document.forms[0].search_zonenm.value != '' ||
document.forms[0].search_zonenm.value!= null) {
if (document.forms[0].search_zoneid.value == '' ||
document.forms[0].search_zoneid.value==null ){
alert('You must input the zone number if you search on
zone id!');
return false;
}
//}
// if true you can submit the form
return true;
}
</script>
1. if "search_bu" is empty
then return false because it is a required field
2. if "search_zoneid has a value
then if search_zonenm is empty return false
3 OR the reverse of 2
if "search_zonenm has a value
then if search_zoneid is emtpy return false
I think what it is doing know is working on all 3 but if I don't input
either a zoneid or zonenm it still asks for the zonenumber?????
It may be number 2 and 3 need to be an OR someway? The problem is
zoneid or zonenm are not rquired but it is acting like they are
required.
They are only required if one of those fields has a value.
thanks,
JanisR
function checkscript() {
if (document.forms[0].search_bu.value == '' ||
document.forms[0].search_bu.value== null ) {
// something else is wrong
alert('The Business Unit is a required field!');
return false;
}
else if (document.forms[0].search_zoneid.value != '' ||
document.forms[0].search_zoneid.value!=null) {
if (document.forms[0].search_zonenm.value == '' ||
document.forms[0].search_zonenm.value==null ){
alert('You must input the zone number if you search on
zone id!');
return false;
}
}
else if (document.forms[0].search_zonenm.value != '' ||
document.forms[0].search_zonenm.value!= null) {
if (document.forms[0].search_zoneid.value == '' ||
document.forms[0].search_zoneid.value==null ){
alert('You must input the zone number if you search on
zone id!');
return false;
}
//}
// if true you can submit the form
return true;
}
</script>