The function beforeInit (sender, config)
{
Ext. Apply (Ext form. Field. VTypes, {
//====================the rule implementation account check whether the input is banned================================//
DAccount: function (val)
{
//the console log (" ok ");
Return (val!='admin' & amp; & Val!='administrator');
},
DAccountText: 'the account be system bans the use, please set again. '
//====================the rule trigger UniEdit1AjaxEvent realize remote call check================================//
Getdoule: function (val)
{
Result=ajaxRequest (sender, 'GetDouleAjaxEvent' [' param0='+ val], false);
//the console. The log (result);
Return (result statusText!='0');
},
GetdouleText: 'existing user account, please reset! '
});
//====================Settings take effect validation rules================================//
Ext. Apply (sender, {allowBlank: false, maxLength: 50, vtype: 'dAccount, vtype:' getdoule, msgTarget: 'side'});
}
CodePudding user response:
Check if it is pure JS, often put two check into the a function;Or each calibration is a function of their own, and then in a calibration data combination under different, calls the different calibration function,