How to escape and unescape strings with jQuery and mySQL

CaptainShannon

New Member
I have a field in my database that has a freetext area, and uses quotes for many things. On my website, that field is shown in a textarea, but I can't simply put the value between the textarea tags. I need to be able to set it with javascript. I use jQuery to do this, via: \[code\]jQuery('#notes').val('{NOTES}');\[/code\]Since the text can have single or double quotes, I'm unsure how to pass this from mySQL, to PHP, to jQuery so I can put it in my textarea. Has anyone done this before?Problem solved using:\[code\]jQuery('#notes').val(jQuery('#your-hidden-div-id').html());\[/code\]
 
Back
Top