The following Javascript will return an error message if the user did not enter any value into the zip code field. The form will submit even if user entered only 1 character. Does anyone know how to change this to at least minimum 5 characters must be entered into the field? Thank you.
…}
var fname = “CustomFields_17_2”;
var fld = document.getElementById(fname);
if (fld.value == “”) {
alert(“Please enter a value for field Postal Zipcode”);
fld.focus();
return false;
}…
<form method=”post” action=”form.php” id=”frmSS2″ name=”frmSS2″ onsubmit=”return CheckForm2(this);”>
<input type=”text” name=”CustomFields[17]” id=”CustomFields_17_2″ value=”” size=’10’ maxlength=’10’>
<input type=”submit” value=”Subscribe” class=”button” />
</form>