I have a form with several fields on it and I want to echo the value from the table in the form. This is an update page for some data already in my database. I have used text fields before and the echo works fine, but if I define a textarea field
<textarea name="course_desc" cols="30" rows="10" value='<?php echo $course_desc; ?>' </textarea>
Its giving me an error saying that the value attribute is not allowed on textarea fields.
echo textarea field on form
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: echo textarea field on form
It's not. Look up the textarea tag http://www.w3.org/TR/1999/REC-html401-1 ... tml#h-17.7:
Code: Select all
<textarea name="course_desc" cols="30" rows="10">
<?php echo $course_desc; ?>
</textarea> mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: echo textarea field on form
Thanks for your quick response. I removed the "value" attribute and just used the "echo php" code and it worked.
<textarea name='course_desc' cols='30' rows='10'></textarea> <?php echo $course_desc; ?></td>
<textarea name='course_desc' cols='30' rows='10'></textarea> <?php echo $course_desc; ?></td>