Hi,

I am Developing one website.There is textrea box where i need to fetch the datafrom database and need display it in textarea box using java script.The text contains special charectars like single quotes and double quotes.
how to escape quotes please help me am using mysql_real_escape_string();but the query results only single quote escape sequence..if it contains double quotes it gets some error.please help me

Recommended Answers

All 2 Replies

Member Avatar for diafol

SHow your code. Sounds strange.

Click Here

please follow the link click update option it will show update form.

Some times update button is not working if the comment field consists doble quotes..

<input type="image" class="update" value="Update" name="Update" title="Update" onclick="document.getElementById('shadowing').style.display='block';document.getElementById('box').style.display='block';document.getElementById('idno').value='<?php echo $exe[0] ?>';document.getElementById('bacno').value='<?php echo $exe[6] ?>';document.getElementById('bname').value='<?php echo $exe[1] ?>';document.getElementById('bcontact').value='<?php echo $exe[2] ?>';document.getElementById('bmake').value='<?php echo $exe[11] ?>';document.getElementById('bmodel').value='<?php echo $exe[12] ?>';document.getElementById('bstatus').value='<?php echo $exe[3] ?>';document.getElementById('bcomplaint').value='<?php echo mysql_real_escape_string($exe[4]) ?>';document.getElementById('bdate').value='<?php echo $exe[7] ?>';"/>

Update button code

if i click update button it will show the update form please help me

i used
document.getElementById('bcomplaint').value='<?php echo mysql_real_escape_string($exe[4]) ?>';

the above query only escapes single quotes please once observe the above link

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.