Validating dropdowns and textboxes before form will submit
Hi,
i am struggling to come up with a solid code for checking that certain dropboxes/ text boxes have been filled in before the form will submit if the submit button is hit. i am also having issues with the code only doing something (changing the colour of a textbox) only after all dropdowns etc have been filled in.
This is the code i am currently using (emails etc have been removed)
var fld = this.getField("Today"); fld.value = util.printd("dd/mm/yyyy",new Date());
var field1 = this.getField("Text1");
if(this.getField("WSJ").value == "")
{
app.alert("Workshop Job must be filled in");
}
else if (this.getField("Bale Count").value == "")
{
app.alert("Bale Count must be filled in");
}
else
{
this.mailDoc({cTo: " ", cSubject: "Warranty Card" + (" ") + this.getField("WSJ").valueAsString, cMsg: " "})
}
field1.fillColor = color.green;
;
