Form wouldn't submit and keep popping out. "Not all fields are valid".
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.form.ValidationTextBox");
dojo.require ("dijit.form.Form");
dojo.require("dijit.form.CheckBox");
dojo.require ("dijit.form.FilteringSelect");
dojo.require ("dijit.form.TextBox");
var valid = true;
function checkPw(formFields) {
//alert (formFields.uPass);
//alert (formFields.uPass2);
if (formFields.uPass !== formFields.uPass2) {
alert("Confirmation password is different.");
valid = false;
}
return valid;
}
function submitIfValid(valid) {
if (valid) {
document.signup.submit();
return true;
}
else {
alert('Not all fields are valid');
return false;
}
}
function both(formFields, valid)
{
submitIfValid(checkPw(formFields));
}
</script>
Help appreciated. Thanks.