开发者

Jquery Validation and MVC2 dumb question

I am trying to do some basic Jquery Validation in my MVC2 project and I keep getting this error...

Microsoft JScript runtime error: Object doesn't support property or method 'validate'

Even before the page loads at this simple script...

    $("#temp1").validate({
        rules: {
            HospitalFinNumber: {
                required: true,
                minlength: 6
            },
            AdminDate: { requried: true }
        }
    });

temp1 is the id of my form, in that form there are id's for HospitalFinNumber, and so on and so forth... Any idea what could be going on? Here are the js files I have included in my site.master

<link href="<%=ResolveClientUrl("~/Content/Site.css")%>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=ResolveClientUrl("~/Content/jqUIcss/jquery-ui-1.8.15.custom.css")%>" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=ResolveClientUrl("~/Content/jqGrid/ui.jqgrid.css")%>" />   
<script src="<%=ResolveClientUrl("~/Scripts/js/jquery-1.6.2.min.js")%>" type="text/javascript"></script>
<script src="<%=Reso开发者_运维技巧lveClientUrl("~/Scripts/js/jquery-ui-1.8.15.custom.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.common.js")%>" type="text/javascript"></script>


Jquery and validation scripts need to be reference in all pages where the validation is use, this rule applies to all javascript files and css.

To avoid repeat the reference you can include them in masterpage

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜