Last active
August 29, 2015 14:14
-
-
Save springcome/9665c9095bb39f5fe94c to your computer and use it in GitHub Desktop.
email validator sample code, smartgwt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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