Hi,
I have created this small piece of code and the purpose is as follows.
We have several machines and I want to display an alert if the machine number does not equal 1301 OR 1302 AND if the character length in digits in another field is less than 2.
I get the alert irrespective of which machine it is including the 1301 AND 1302
I wonder if someone can help me please
Regards
Paul
I have created this small piece of code and the purpose is as follows.
We have several machines and I want to display an alert if the machine number does not equal 1301 OR 1302 AND if the character length in digits in another field is less than 2.
I get the alert irrespective of which machine it is including the 1301 AND 1302
Code:
<script language = "javascript">
// Start PTDREF Script
function ptd() {
var msg = "";
var MC = document.getElementById("hidMCode").value;
var Print = document.getElementById("txtPrintNo").value.length;
if (Print <2 && MC!= "1301" || MC!= "1302")msg+="Is This A Printed Reference \nIf So Please Indicate On Form";
if (msg != "") alert(msg);
return msg==""
}
// End PTDREF Script
</script>
I wonder if someone can help me please
Regards
Paul