Sharepoint 2010中的JQuery [英] JQuery in Sharepoint 2010

查看:129
本文介绍了Sharepoint 2010中的JQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题:
我使用jquery validate()
来验证Sharepoint的web部件和应用程序页面
jQuery验证工作正常,并检查所有规则并显示消息,但问题是:

如果规则正确,则提交按钮可以正常工作,并且提交数据的次数是验证永不失败的次数,但是一旦由于某种原因(例如必填字段)验证失败,用户将更正错误并尝试再次提交数据,但是该按钮即使验证已更正,也不再提交

I have an issue:
i am validationg webparts and application pages for sharepoint using jquery validate()

the jquery validation works fine and checks all the rules and displaying messages as well,but the issue is that:

if the rules are fine the submit button works and submits data as many times as the validation never fails but once the validation fails for any reason such required field, the user corrects the error and try to submit the data again but the button no more is submitting even if the validation is corrected

$("#form1").validate({

        rules: {  <%=TextBox1.UniqueID%>:{ required: true },  <%=TextBox2.UniqueID%>: { required: true} },
        messages: {
             <%=TextBox1.UniqueID%>: { required: "<span  style=''color:black''>* Required Field *</span>" },

             <%=TextBox2.UniqueID%>: { required: "<span  style=''color:red''>* Required Field *</span>" }
        },
        errorLabelContainer: "#errorcontainer",
        wrapper: ''li''

    });



注意:完全相同的代码在asp.net普通页和母版页上都可以正常工作.



Note: The exact same code is working fine in asp.net normal and master pages

推荐答案

(#form1").validate({ 规则:{<%= TextBox1.UniqueID%>:{必需:true},<%= TextBox2.UniqueID%> ;: {必需:true}}, 讯息:{ <%= TextBox1.UniqueID%> ;: {必填:< span style =" color:black"> *必填字段*</span>"}, <%= TextBox2.UniqueID%> ;: {必填:< span style =" color:red"> *必填字段*</span>"} }, errorLabelContainer:#errorcontainer", 包装器:"li" });
("#form1").validate({ rules: { <%=TextBox1.UniqueID%>:{ required: true }, <%=TextBox2.UniqueID%>: { required: true} }, messages: { <%=TextBox1.UniqueID%>: { required: "<span style=''color:black''>* Required Field *</span>" }, <%=TextBox2.UniqueID%>: { required: "<span style=''color:red''>* Required Field *</span>" } }, errorLabelContainer: "#errorcontainer", wrapper: ''li'' });



注意:完全相同的代码在asp.net普通页和母版页上都能正常工作



Note: The exact same code is working fine in asp.net normal and master pages


这篇关于Sharepoint 2010中的JQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆