Hello
Tried adding the semicolon's, no luck...
- <script type="text/javascript">
-
function checkFields9(){
-
if (shopform.totalhwtemp.value<=16) {
-
return true
-
}else{
-
shopform.hw.value = "0.00";
-
shopform.priceperpiece.value = "0.00";
-
shopform.subtotal.value = "0.00";
-
shopform.total.value = "0.00";
-
shopform.totalbund.value = "0.00";
-
document.getElementById("skjulpris").style.display = "block";
-
document.getElementById("vispris").style.display = "none";
-
document.getElementById("upload").style.display = "none";
-
alert("---IMPORTANT INFORMATION !---\n\n\The requested quantity is larger than 16 dm2 (1 production panel) and at the moment not available.\n\n\Please change quantity or direct this enquiry to sales@printline.dk or by phone + 45 66 10 74 60.\n\n\All quantities will soon be an option on our webshop.");
-
return false
-
}
-
-
}
-
</script>
The sceneraio is as follows:
I have this field in a form:
[HTML]<input type="text" value="0.0" name="totalhwtemp" onblur="" size="3" style="background-color: transparent; border-style: solid; border-width: 0px 0px 0px 0px; border-color: darkred; text-align:right; font-family:Helvetica, sans-serif; font-size:11px; color:#000000;">[/HTML]
I do the check like this:
[HTML]<img src="../../images/beregn_de.jpg" id="beregn" border="0" onclick="checkFields9();checkFields3_1()" />[/HTML]
In IE the alert box comes up if the field totalhwtemp is above 16, but not in Firefox. Tried the error console in Firefox. I get an error saying that shopform is not defined and then the line "if (shopform.totalhwtemp.value<=16) {" is highlighted.
I believe my form is defined in the line that says:
[HTML]<form method="post" name="shopform" action="upload.php" onkeypress="return disableEnterKey(event)" id="shopform" onsubmit=""> [/HTML]