Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

escape single quote in input type=hidden

 
Vivek Gupta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I retrieve the value in the hidden input if there is a single quote involved in the value of the hidden attribute

For example
<INPUT TYPE=hidden name='hdInput' value='JSP's Content'>

At back-end(Java Code), I could only retrieve JSP for hdInput.
How can I get the complete JSP's Content
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the HTML forum.
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try putting the value attribute in double quotes if you are sure that double quotes wont be there.

 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use hidden textarea with absolute positioning, you don't need to escape anything.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic