Jquery validate showerrors display name

I would like to add the name of the errors to my function so users know wich fields they have to check.

This is my current function

showErrors: function(errorMap, errorList) {
            var summary = "Please check following errors:";
            $.each(errorList, function() {
                summary += " * " + this.message + "<br>" ;
            });
            $('.errorbox').html(summary);
            this.defaultShowErrors();
        },
        submitHandler: function() {
            alert("submitted!");
        }


    });

How can i do this?

Answers


As you are using the Bassistance.de validation plugin, the easiest option to you is to add a friendly insturction message to the title parameter to each input control. This message will then be used as instruction text in the error message which appears. Here is an updated fiddle showing how this works: http://jsfiddle.net/xTdYr/3/

Alternatively, you can manually add the rules in the instanciation call of the .validate() method by using the messages parameter, details here: http://docs.jquery.com/Plugins/Validation/rules


Need Your Help

PHP reindexing an array?

php arrays indexing reset

Forgive my noobness again. I've got an array with 20+ values in it and I take every 20 to shove in my database and then chop them off the front of the array. I want to restart the array's indexes b...