• Post Reply Bookmark Topic Watch Topic
  • New Topic

validation of entire form

 
Ananth Majumdar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I'm using a form in a panelGrid.

I'm having two text feilds t1, t2 I have to validate the following condition

t2 becomes a required feild if and only if t1 is entered otherwise t2 can be empty.. so i cant put a required=true for the inputText t2. I wrote a custom validator and binded it to the feild t2 but the problem is that the validator is not called when i am not writing anything in that..so I thought of putting a validator at the panelgrid or form level but there is no option like that. what can be done.. please help?
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why you need a validator here ? can't you do this check while submitting the page and display appropriate error message.

Thanks,
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Validate using JS or do it straight in the backing bean.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!