This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling html tags in text input fields in Validator

 
Mallika R Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a rule in Validator framework that disallows users from entering html tags ? Or do we have to use mask and regular expressions to prevent users from entring valid html tags ? I was wondering what the easiest method is - to implement filtering of html code in text fields.

Thanks in advance for your response.

Mallika.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
best way is to use mask. if you restrict data entry to only alphanumeric, use the alphanumeric regex mask. otherwise, you need a regex that will accept everthing except the '<'.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic