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.

Post web related questions in JSP forum.
Error: use != instead of !==

..
formFields.uPass != formFields.uPass2
..

nope it still doesn't work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.