Hi Bastien,
your script contains some errors...
here is a version that might work:
<script language="javascript">
<!--
function validate()
{
if (document.form.quant.value > 0) {
alert("Please specify quantity of Estuary to purchase");
return false;
}
if (document.form.bodyColour.value == "") {
alert("Please choose a Body Color for the Estuary");
return false;
}
if (document.form.baseColour.value == "") {
alert("Please choose a Base Color for the Estuary");
return false;
}
}
function popup() {
var aWindow;
aWindow = window.open("","","directories=no, scrollbars=no, resizable=no, status=no, left=450, top=350, toolbar=no, menu=no, width=125, height=100");
}
//-->
</script>
first:
forgot the braces in comparison:
if (bla) {
second:
i guess you wanted to write:
if (document.form.bodyColour.value == "")
with a '=='
and there was a comma after the
window.open();,
hth
chris
Bastien wrote:
Hi All,
The below is code that is generated through PHP and copied from the browser. In it are two javascript functions that I can't get load/fire correctly...
1.Validate function to validate the form before submission
2.Popup function to act as a sort of tool tip where the use hovers over a link and a window pops up with the option desc.
<td width="25%"><center><b>Take It</b></td></tr><tr><td><font color=blue><a target="main" OnMouseOver="javascript:popup();
return=true" onMouseOut="javascript:aWindow.close()";>
Sterilizer</font></a></td><td align = center>$75.00</td>
<td align = center><input type = checkbox name = 2></td></tr></table><tr><td>Quantity</td><td>
<p align =left><input name = quant value = "" type = text size = 3 maxsize = 3>
</td></tr><tr><td>
<input type = submit value = "Add Item to Cart" OnClick="javascript:validate();">
<input type = reset....