• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email validation using validation.xml

 
Archana Singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have an email field to validate in my form and I need to do it using validation.xml.I am using struts 1.1. Here is the code snippet from validation.xml -
<field property="dto.contactPerson.email" depends="required,email">
<arg0 key="MyForm.contactPerson.email.displayname"/>
</field>
The key is defined in ApplicationResources.properties file.The problem is - When I enter NOTHING in the email field, it says that it is required(which means required is working). But if I enter junk characters, it is taking them and does not validate them! Can anyone tell me wut do I need to do to fix this..
 
Eric Sexton
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "its taking them", are you saying that your form is getting submitted?
Is your email validateEmail method getting called? I would put a System.out in there to check to see if it is actually getting called.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic