Showing <textarea> value in <form> (value from php)
by pizzipie from LinuxQuestions.org on (#5M1VJ)
<textarea> values came from a query of my Database:
$query="SELECT * from hdata WHERE Id=".$recId.";";
part of the hdata returned data is - $row['tests'], $row['results'], $row['notes']
I want these values to show up in my <form>> So I have a chance to edit them if I want.
Code:<form>
...... Other input data .....
<textarea name='tests' id='tests' rows="3" cols="40" value='<?php echo $row[tests]; ?>'></textarea><br>
<textarea name='results' id='results' rows="3" cols="40" value='<?php echo $row[results]; ?>'></textarea><br>
<textarea name='notes' id='notes' rows="3" cols="40" value='<?php echo $row[notes]; ?>'></textarea><br>
</form>I know that <textarea> doesn't have a 'value' attribute so how do I accomplish setting the <form> <textarea>'s to show the php values?
See Insert to show what this code does. NOTE: Not using ' ' around tests. results, and notes.
Attached Thumbnails
$query="SELECT * from hdata WHERE Id=".$recId.";";
part of the hdata returned data is - $row['tests'], $row['results'], $row['notes']
I want these values to show up in my <form>> So I have a chance to edit them if I want.
Code:<form>
...... Other input data .....
<textarea name='tests' id='tests' rows="3" cols="40" value='<?php echo $row[tests]; ?>'></textarea><br>
<textarea name='results' id='results' rows="3" cols="40" value='<?php echo $row[results]; ?>'></textarea><br>
<textarea name='notes' id='notes' rows="3" cols="40" value='<?php echo $row[notes]; ?>'></textarea><br>
</form>I know that <textarea> doesn't have a 'value' attribute so how do I accomplish setting the <form> <textarea>'s to show the php values?
See Insert to show what this code does. NOTE: Not using ' ' around tests. results, and notes.
Attached Thumbnails