Validating user input, when the form element data contains ' or " or > or <
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Avinesh_Singh
Posted On:   Monday, April 9, 2001 06:36 AM

When we try to display a string containing a ' or " in a html form generated by a jsp page or a servlet then the displayed string is truncated. For an example :








If you open this in a browser it displays only
before
in place of
before "after

I do not want to restrict a user from entering either ' or " in a text area or a text field.

What may be the probable solution ??

Re: Validating user input, when the form element data contains ' or " or > or <

Posted By:   Michael_Wax  
Posted On:   Monday, April 9, 2001 08:28 AM

On the input side, you should have no problem: the user input will be URL encoded before transmission back to the server, so that special characters should not cause any problems. If you want to display special characters, I think that you will need to convert them into HTML escape characters. For example, for a double quote ("), you could use " or ", and for < you could use < or <
About | Sitemap | Contact