Skip to content

Instantly share code, notes, and snippets.

@springcome
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save springcome/9665c9095bb39f5fe94c to your computer and use it in GitHub Desktop.

Select an option

Save springcome/9665c9095bb39f5fe94c to your computer and use it in GitHub Desktop.
email validator sample code, smartgwt
public class EmailValidatorSample {
private Canvas drawForm() {
TextItem email = new TextItem("email");
email.setWidth("*");
email.setValidators(emailValidator());
}
private RegExpValidator emailValidator() {
return new RegExpValidator("^([a-zA-Z0-9_.\\-+])+@(([a-zA-Z0-9\\-])+\\.)+[a-zA-Z0-9]{2,4}$");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment