Home > Back-end >  NuiGui how to realize the control for multiple custom rules check?
NuiGui how to realize the control for multiple custom rules check?

Time:09-15

Newly developed NuiGui a trouble problems in the project, the text box input account name, need to be done at the same time to the account name "moniker check" and banned the use of the name of the calibration "two custom check, I wrote two validation rules, both separate validation rules when using no problem, but just can't check for the two rules, don't know where to write it? Trouble master to help me see, the code is as follows:
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,
  • Related