Coolite控件验证

1、不为空:设置coolite控件的 AllowBlank="false"

2、使用正则表达式验证

 

< script type = " text/javascript " >  
   
function  InitForm()
    {
        Ext.form.VTypes[
' actionTitleVal ' =   / ^[\u4e00-\u9fa5_A-Za-z0-9\s]+$ / ;
        Ext.form.VTypes[
' actionTitleMask ' =   / [\u4e00-\u9fa5_A-Za-z0-9\s] / ;
        Ext.form.VTypes[
' actionTitleText ' =   ' can not input special string. ' ;
        Ext.form.VTypes[
' actionTitle ' =   function (v){ return  Ext.form.VTypes[ ' actionTitleVal ' ].test(v);}
    }
    
    InitForm();
< / script>

 

                                    <ext:TextField ID="txtFlowName" runat="server" Vtype="actionTitle" AllowBlank="false"
                                        MaxLength="250" AutoDataBind="true" Width="400">
                                    </ext:TextField>

在控件中的Vtype格式中添加先前定义的Vtype类型。

你可能感兴趣的:(OO)