File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Required field usage

 
Shaan patil
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know will this work when I dont input any value in the birthDate text box of the form ?

Specifically what I want to know is will this be validated incase I dont input anything in birthdate field ?

<field property="birthDate"
depends="date">
<arg0 key="inputForm.birthDate" />
<var>
<var-name>datePattern</var-name>
<var-value>MM-dd-yyyy</var-value>
</var>
</field>
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With your definition, any empty field will not generate any validation messages. If you need the field to be filled in, change your depends value to "required,date".

- Brent
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
depends="date" this is just date validation.
required is the not null validation.

You need to add two validations for the Birthday field

1. Not null Check.
2. If not null then check for valid date.

depends = "required,date" address your issue
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic