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..
php + javascript
Moderator: General Moderators
Code: Select all
<textarea>Your variable will go in here, not a value attribute</textarea>