darrylm
23 Mar 2012, 3:08 AM
I've added a format validation to a model that requires a regex to be entered.
The format validation object does not have properties for matcher or message - so I have added them. But when I enter the regex it as single quotes around the regex - which is not what is required for the matcher.
Anyone know how to get around this?
Here is the generated code in designer:
Ext.define('myPoliBot.store.MyFormatValidation', { extend: '',
config: {
type: 'format',
field: 'email',
matcher: '/^(([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+){0,1}$/',
message: 'must be a valid email for us'
}
});
BTW - have used the email validation object - but this seems to also imply a presence validation on email field when it is left blank.
The format validation object does not have properties for matcher or message - so I have added them. But when I enter the regex it as single quotes around the regex - which is not what is required for the matcher.
Anyone know how to get around this?
Here is the generated code in designer:
Ext.define('myPoliBot.store.MyFormatValidation', { extend: '',
config: {
type: 'format',
field: 'email',
matcher: '/^(([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+){0,1}$/',
message: 'must be a valid email for us'
}
});
BTW - have used the email validation object - but this seems to also imply a presence validation on email field when it is left blank.