This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin 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!