Thursday, May 16, 2013

One single field validation or Validate Form Only Certain Fields in Magneto

Hi, If you need to validate one field of form before submitting form that is onchange or on blur one or single field validation in Magento form use below code i took one ex of email validation if you need to validate a email filed while editing field it self use this code so error msg or validation will happen once you change to other field no need for submitting all form
 <script>
jQuery(document).ready(function() {
    jQuery('.input-text-taxvat').blur(
        function() {
            Validation.validate(this);
         }
    );
    });
</script> 
Note:- jQuery(’.email).blur where .email is class of email filed

No comments:

Post a Comment