Hello I have a php code which by echo calls the javascript function expand(txt)
with the parameter 'txt'
echo "<div onclick=javascript:expand('$hint1')>$valueX</div>";
function expand(txt)
{
document.getElementById("targetDiv").value=txt;
}
my problem is that this script works only if the '$hint1' is a string without white space, example if $hint="car" everything works but if $hint="red car" the javascript is not working.
Any help would be much appreciated! Thanks!