Fletch wrote:
>You need to have valid javascript code, which >is not happening when you
>have several lines in text. You want to get to
>output +="Line1\nLine2\nLine3\n"; // += is the >same as a=a+
>so
><? function jsencode($str)
>{
> return implode('\n',explode
>("\n",$str)); //Could use str_replace -
>probably better.
>}?>
>output+="<? echo jsencode($text); ?>";
But why if I pass the paragraph of text from onclick event on a checkbox,
to show it on textarea, it can perform well although the text is a
paragraph.
<td ><input type=checkbox name="chksur2"
onclick="getSurcharge('duties',this.value)" value="<? echo $strSurcharge1;
?>">
<script language="JavaScript">
function getSurcharge(id, value)
{
document.getElementById(id).value= value;
//to show text on a textarea
}
</script>
<?php $strSurcharge1 = " (paragraph of text) ";
?>
>> Stay informed about: php in javascript