Reputation: 5747
When using input type text, I validate using the following code.
<input type="text" name="subject" value="<?php echo $form->value("subject"); ?>">
<?php echo $form->error("subject"); ?>
<textarea name="body" cols="10" rows="10"></textarea>
<?php echo $form->error("body"); ?>
As you can see, I am also using a textarea.
How would I add the value="<?php echo $form->value("body"); ?>"
to the textarea?
Thanks
Upvotes: 0
Views: 346
Reputation: 1244
Put it within the tag itself, but that's not about validation so are you asking something else?
<textarea name="body" cols="10" rows="10"><?php echo $form->value("body"); ?></textarea>
Upvotes: 1
Reputation: 22957
Put it in between the <textarea>
tags.
<textarea name="body" cols="10" rows="10"><?php echo $form->value("body"); ?></textarea>
Upvotes: 2