Escaping double quotes in input value

Part of my messaging system involves putting unknown text into the value=" " of an input type="hidden" element. I truncate the text if there is a double quote in there. So, my question is, how do escape a double quote when it is set in the value attribute? doing \" doesn't seem to work, should I convert it to " (I think that's it for double quote, doesn't matter I could look it up if i need to) ? <br />
<br />
Thanks.<!--content-->You should transpose all HTML special characters to their corresponding character entities.<br />
<br />
HTML Special Chars:<br />
" & ' < ><!--content-->With the double quote specifically being:<br />
<br />
&#34; or &quot;<br />
<br />
Others can be found at <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/sgml/entities.html#h-24.4.1">http://www.w3.org/TR/html4/sgml/entities.html#h-24.4.1</a><!-- m --><!--content-->for reference, i had the &-code up there for the double quote, it just converted it to the double quote, haha, whoops.<!--content-->
 
Back
Top