php + javascript
Posted: Wed Mar 21, 2007 9:10 am
i have a form with a textarea..now i want to assign an initial value to it using javascript..the value will be fetched from a database(mysql)and assigned to a php variable...
the code is somewhat like this...
<form name="info"id="f1">
<textarea name="content" id="t1" value="<?php echo("$content"); ?>";></textarea>
</form>
this code is not working..
i also tried accessing the textarea from javascript
document.info.content.value=<?php echo("$content");?>;
this is also not working...the value stored in $content does not get displayed in the textarea when i load the page
can anyone help me out on this..
the code is somewhat like this...
<form name="info"id="f1">
<textarea name="content" id="t1" value="<?php echo("$content"); ?>";></textarea>
</form>
this code is not working..
i also tried accessing the textarea from javascript
document.info.content.value=<?php echo("$content");?>;
this is also not working...the value stored in $content does not get displayed in the textarea when i load the page
can anyone help me out on this..