Jump to content

problem with quotation marks...


chelnov63

Recommended Posts

hi guys the following code works fine (excpet when the text has single quotation marks) e.g

 

<script type="text/javascript">
<!--
function changeContent(desc, name)
{
	document.getElementById('content_main').innerHTML = desc;
}
//-->
</script>

<span id="content_main">This is the main body</span>

<p><a class="button" href="#" onclick="changeContent('<?php echo $row_brass["description"] ?>', '<?php echo $row_brass["name"] ?>')">View profile</a>

 

 

Now if the text that $row_brass["description"] contains does not have any single quotation marks then the above code works fine.... for e.g if it contains the text Sam is the web developer then it works fine... however if it contains for e.g

Sam's work was done then the span tag doesnt update at all...

 

any ideas what could be the problem? thanks in advance for your help

Link to comment
https://forums.phpfreaks.com/topic/142456-problem-with-quotation-marks/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.