• 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 '<'.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic