Reputation: 201
I'm using the following to set the value of a text area..
<?php
$description=$myrow["description"];
?>
<textarea name="description" value="<?php echo htmlspecialchars($description); ?>" readonly></textarea>
but it doesn’t appear to be working. The value of message is not null. Does anyone have any idea why it's not filling the value?
Upvotes: 0
Views: 60
Reputation: 23948
<textarea>
does not have value
attribute like <input type="text" value="InputValue"/>
Do like this:
<textarea name="description" readonly><?php echo htmlspecialchars($description); ?></textarea>
Upvotes: 3
Reputation: 1829
try this:
<textarea name="description"><?php echo htmlspecialchars($description); ?></textarea>
textarea value not defined using value property like value ="value" you need to do like
<textarea> value </textarea>
Upvotes: 0
Reputation: 989
Try This
<?php
$description=$myrow["description"];
?>
<textarea name="description" readonly><?php echo htmlspecialchars($description); ?></textarea>
Upvotes: 0
Reputation: 6755
You need to put textarea value like this:
<?php
$description=$myrow["description"];
?>
<textarea name="description" readonly><?php echo htmlspecialchars($description); ?></textarea> <!--passing the value between opening and closing textarea tags.-->
Upvotes: 1