hi,

I am, validating a form and it seems to half work. An alert is displayed when there is a field missing, but the form still submits. ANy ideas?

<SCRIPT LANGUAGE="JavaScript">
<!--
var commission;
var sub_total;
var countryvalue;
var SourceCountry;
var expenditure;
var msg="";

function validate() {
if(_DominoForm.expenditure.value=="") {
msg="\nYou must enter an expenditure";
}
if(_DominoForm.SelectSourceCountry.value == "Select Country") {
msg=(msg + "\n You must select the country");
}
if(msg=="") {
alert("it works");
return true;
}
else{
alert(msg);
return false;
}
}

</HEAD>
<BODY TEXT="000000" BGCOLOR="white">

<FORM onSubmit="validate()" METHOD=post ACTION="wbm_content_SIAL.nsf/sc-1?OpenForm&Seq=1" NAME="_DominoForm">


<INPUT NAME="name" VALUE="">
<INPUT NAME="email" VALUE="">
<INPUT NAME="telephone" VALUE="">


<SELECT NAME="SelectSourceCountry" onchange="calculate(this.form)">
<OPTION VALUE="Select Country">Select Country
<OPTION VALUE="England">England
<OPTION VALUE="France">France
<OPTION VALUE="Germany">Germany
<OPTION VALUE="Japan">Japan
<OPTION VALUE="Singapore">Singapore</SELECT>


<SELECT NAME="CommodityArea" onchange="calculate(this.form)">
<OPTION VALUE="Construction - GSC">Construction - GSC</SELECT>


<SELECT NAME="CustomsDescription">
<OPTION>Jackets &amp; Blazers</SELECT>

<INPUT NAME="expenditure" VALUE="" onchange="calculate(this.form)">

<INPUT NAME="commission" VALUE="" value=0 onchange="calculate(this.form)">

<INPUT NAME="total" VALUE="" disabled>
<input type=submit value="ADD" >
</form>