submitHandler was giving stack errors in JavaScript when you tried to call form submit dynamically (very odd!). Assigned an onclick function on the button that shows the pop up and the invalidHandler of the validator hides if if form is invalied.