Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checking whether the date entered within textfield does comply with the format given

 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have a text field, named "datedtext", which accepts date from user.

The property associated with date is of Date datatype in my entity class. What i want is that when the user enters the date and press enter, it should check whether it complies to format given.

Here is what i tried



How can i check whether it is in a given format? If it complies, parse() method will convert it into Date object.
All suggestions are welcomed.
Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scroll down the topics on the first page for
'leave maskformatter null' (or similar)

you'll find an example there
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic