需要在JQuery验证中提供帮助 [英] Need Assistent in JQuery Validation

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

问题描述

亲爱的专业人士,

使用Jquery验证控件是空的,下面是我的JQUERY以及如何调用它进入我的文本框,它工作正常,但我需要的是,我需要根据div中的控件来检查这个验证,希望你们理解,请帮助我



以下是我的JQUERY

 <   link     href   =  ValidationEngine.css < span class =code-attribute>   rel   =  stylesheet    type   =   text / css    /  >  
< style type = text / css >
auto-style1 {
width 611px;
}
< / style >
< script type = text / javascript src = http://ajax.googleapis.com/ajax/libs/jquery /1.8.3/jquery.min.js\"> < / script >
< script 类型 = text / javascript src = http:// cdn.ucb.org.br/Scripts/formValidator/js/languages/jquery.validationEngine-en.js\"

charset = utf-8 > < / script >
< script 类型 = text / javascript src = http://cdn.ucb.org.br/Scripts/formValidator/js/jquery.validationEngine.js

charset = utf-8 > < / script >
< script 类型 = text / javascript >
$( function (){
$( #form1)。validationEngine(' attach',{promptPosition: topRight});
});
function DateFormat(字段,规则,i,选项){
var regex = / ^( 0 ?[1-9] | [ 12 ] [0-9] | 3 [ 01 ])[\ / \ - ]( 0 ?[1-9] | 1 [ 012 ])[\ / \-] \\\ { 4 } $ /;
if (!regex.test(field.val())){
return 请以dd / MM / yyyy格式输入日期。
}
}
< / script >

下面的行是我调用上面的JQUERY

< 输入 类型 = text class = 验证[required] runat = server 名称 = pgUsername id = txtusername >

解决方案

function (){


#form1)。validationEngine(' attach',{promptPosition: topRight});
});
function DateFormat(字段,规则,i,选项){
var regex = / ^( 0 ?[1-9] | [ 12 ] [0-9] | 3 [ 01 ])[\ / \ - ]( 0 ?[1-9] | 1 [ 012 ])[\ / \-] \\\ { 4 }


/;
if (!regex.test(field.val())){
return 请以dd / MM / yyyy格式输入日期。
}
}
< / script >

下面的行是我调用上面的JQUERY

< 输入 类型 = text class = 验证[required] runat = server 名称 = pgUsername id = txtusername >


Dear Professionals,
Am validating controls which is empty by using Jquery, and below is my JQUERY and how am calling in that into my textboxes, it work fine, but my need is, I need to check this validation based up on controls in div, hope you guys understand, kindly help me

Below is my JQUERY

<link href="ValidationEngine.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .auto-style1 {
            width: 611px;
        }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/languages/jquery.validationEngine-en.js"

    charset="utf-8"></script>
<script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/jquery.validationEngine.js"

    charset="utf-8"></script>
<script type="text/javascript">
    $(function () {
        $("#form1").validationEngine('attach', { promptPosition: "topRight" });
    });
    function DateFormat(field, rules, i, options) {
        var regex = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
        if (!regex.test(field.val())) {
            return "Please enter date in dd/MM/yyyy format."
        }
    }
</script>

Below line is where i called the above JQUERY

<input type="text" class="validate[required]"  runat="server" name="pgUsername" id="txtusername"  >

解决方案

(function () {


("#form1").validationEngine('attach', { promptPosition: "topRight" }); }); function DateFormat(field, rules, i, options) { var regex = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}


/; if (!regex.test(field.val())) { return "Please enter date in dd/MM/yyyy format." } } </script> Below line is where i called the above JQUERY <input type="text" class="validate[required]" runat="server" name="pgUsername" id="txtusername" >


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

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