JQuery EasyUI 之 validatebox plugin(Reproduced)

自定义验证:

            $.extend($.fn.validatebox.defaults.rules,{
                remote2:{
                    validator:
function (value,param){
                        
var  postdata = {};
                        postdata[param[
1 ]] = value;
                        
var  result = $.ajax({
                            url:param[
0 ],
                            dataType:
" json " ,
                            data:postdata,
                            async:
false ,
                            cache:
false ,
                            type:
" post "
                        }).responseText;
                        
return  result == " true " ;
                    },
                    message:
" Please fix this field. "
                }

            }); 

posted @ 2011-07-15 17:36 nikytwo 阅读(12) | 评论(0) |  编辑

使用方式:

a方式:

 

  < script  type ="text/javascript"  src ="../easyloader.js" ></ script >

 <input id="dd" class="easyui-datebox" required="true"></input>

b方式:

步骤1.

 < script  type ="text/javascript"  src ="../easyloader.js" ></ script >

 <input id="dd2" type="text"></input>

 

 步骤2. 

 

$( function  () {
    easyloader.locale 
=   ' zh_CN '     // 中文后 1.2.3版本的日期自动格式为 yyyy-MM-dd。
    using( " datebox " , function () {
        $(
' #dd2 ' ).datebox({
            required:
true ,
            formatter:
function (date){
            
var  y = date.getFullYear();
            
var  m = date.getMonth() + 1 ;
            
var  d = date.getDate();
            
return  y + "" + m + "月 " + d;
        }
    });
}); 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值