J
jr
There are 4 + fields in a search form, bu, cart_id, zoneid, zonenm.
bu is required, search_bu in the form
however if the zoneid is searched on it requires the zonenm to make a
complete search.
testing:
1. click on BU & zoneid
asks for zonenm
2. click on cart_id
asks for bu this is okay but then
it asks for the zonenm ???????
The only time I want it to ask for the zonenm is when the zoneid is
checked.
I have the zonenm in a nested if that first asks whether there is a
value in the zoneid.
It shouldn't hit this 2nd if??
3. if I click zoneid
asks for the bu okay
put in bu
asks for zonenm okay
4. put in zone num
asks for bu
put in bu
it submits but without asking for the zoneid ????
thanks,
Janis r.
<script type="text/javascript">
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>
bu is required, search_bu in the form
however if the zoneid is searched on it requires the zonenm to make a
complete search.
testing:
1. click on BU & zoneid
asks for zonenm
2. click on cart_id
asks for bu this is okay but then
it asks for the zonenm ???????
The only time I want it to ask for the zonenm is when the zoneid is
checked.
I have the zonenm in a nested if that first asks whether there is a
value in the zoneid.
It shouldn't hit this 2nd if??
3. if I click zoneid
asks for the bu okay
put in bu
asks for zonenm okay
4. put in zone num
asks for bu
put in bu
it submits but without asking for the zoneid ????
thanks,
Janis r.
<script type="text/javascript">
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>