why i cant display value in the textArea? let's say i retrieve from database and assign as $Comment.....and the code is like the following
Code:echo "<textarea name=\"txtEditComment\" cols=\"45\" rows=\"10\" value=$Comment/></textarea>";
Printable View
why i cant display value in the textArea? let's say i retrieve from database and assign as $Comment.....and the code is like the following
Code:echo "<textarea name=\"txtEditComment\" cols=\"45\" rows=\"10\" value=$Comment/></textarea>";
The value for a textarea goes between the start and end tags, eg:
Code:echo "<textarea name=\"txtEditComment\" cols=\"45\" rows=\"10\"/>$Comment</textarea>";
Thats bad code. This is better code:Quote:
Originally Posted by kenny_oh
Code:<textarea name="txtEditComment" cols="45" rows="10">
<?php echo(htmlspecialchars($Comment)) ?>
</textarea>