I’m using a EmailTextField in a wicket 1.5 app in order to log users. According to GMail alias, a + symbol may be present in email but wicket doesn’t allow it. Is there a way to accept extra symbol in the validator?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to write your own validator:
Here I just add two pluses to original Wicket regexp for validating e-mails (tried to highlight pluses in bold):
^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-+]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*((\\.[A-Za-z]{2,}){1}$)
After that you could use simple TextField with your validator instead of EmailTextField. Like that: