Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

h:inputText field, Numeric and Length validation  RSS feed

 
Mary Joe
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got <h:inputText field,
I need to raise a validation message if the value entered is not Numeric and and the length should be exactly 6,
how best to do this?
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,

your inputtext filed is going to bind with one of the backing attribute, so make that variable in the backing bean as Integer and use <f:validateLenght maximum="6" minimum="6" /> in the jsp file will solve your problem.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!