简体   繁体   中英

Jquery Form Validation

I am using the following validation code on my web app

demo : http://www.position-relative.net/creation/formValidator/demos/demoValidators.html

is there any way to hide that popup thing after 10 second ? now when you submit its keep displaying ....

these are the codes used for ceating that effect

http://www.position-relative.net/creation/formValidator/js/languages/jquery.validationEngine-en.js http://www.position-relative.net/creation/formValidator/js/jquery.validationEngine.js

<script>
        jQuery(document).ready(function(){
            // binds form submission and fields to the validation engine
            jQuery("#formID").validationEngine();
        });

        /**
        *
        * @param {jqObject} the field where the validation applies
        * @param {Array[String]} validation rules for this field
        * @param {int} rule index
        * @param {Map} form options
        * @return an error string if validation failed
        */
        function checkHELLO(field, rules, i, options){
            if (field.val() != "HELLO") {
                // this allows to use i18 for the error msgs
                return options.allrules.validate2fields.alertText;
            }
        }
    </script>
var t = setInterval(function() {
   //alert('b');
   $(".formErrorContent").hide();
   $(".line1").hide();$(".line2").hide();$(".line3").hide();$(".line4").hide();$(".line5").hide();
   $(".line6").hide();$(".line7").hide();$(".line8").hide();$(".line9").hide();$(".line10").hide();
   },8000);

this code put on above header tag

<script>

    setInterval(function() {
        $(".formError").parent('.formErrorOuter').remove();
        $(".formError").remove();
},  2000);
</script>

try it.it's work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM