• Post Reply Bookmark Topic Watch Topic
  • New Topic

html interpretation

 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have a text field in my form. if the user enters some html in the text field, I don't want the html to be interpreted when the data entered in text field is displayed.

for example data entered in text field is "enter <br> your name".

currently, "your name" comes to the next line when i display the form field enetered. how can I avoid this.

Thanks,
Neeraj.
 
bnkiran kumar
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a filter your application and encode the request parameter.....
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not so much encoding you need to do, but escaping the "<" and ">" characters. Turn ">" into "&gt;" and "<" into "&lt;" and see it that is sufficient.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using <cut> to display the value on the page will automatically handle this.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your inputs.

regards,
neeraj.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!