/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (Ext && Ext.form.VTypes) { var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/; Ext.apply(Ext.form.VTypes, { EmailList: function(val) { var addrs = val.split(','); var idx = Ext.each(addrs, function(item) { return email.test(item.trim()); }); return !Ext.type(idx); }, EmailListText: 'Not a valid email address or comma separated list of email addresses.' }); }