jQuery validation plugin error: TypeError: validator is undefined

后端 未结 13 2379
无人及你
无人及你 2020-12-09 03:10

Here is html code for the form:

13条回答
  •  心在旅途
    2020-12-09 03:13

    You need to include the validation script in the head of your document.

    Like this:

    
    

    Also, please check in the rendered HTML that your form ID is correct.

    I use this code for calling validate on my sites

            //Validate Form
            var ids = [];
            $("form").each(function () {
                ids.push(this.id);
            });
            var formId = "#" + ids[0]
            $(formId).validate();
    

提交回复
热议问题