I am currently creating a registration form and validating it using the Magento VarienForm method. I just want to know how I can get an answer, has the user passed the test or not? If this fails, I will stop ajax. Here is my code:
var dataForm = new VarienForm('register-form', true);
jQuery('#register-form').submit(function(e){
jQuery.post( "<?php echo $baseUrl; ?>quickcheckout/index/register", jQuery( "#register_form_mobile" ).serialize()).done(function( data ) {
var successRegister = isNumber(data);
if(successRegister)
{
location.reload();
}
else
{
console.log(data);
}
});
})
source
share