lauralee Posted November 21, 2010 Share Posted November 21, 2010 I need to allow a user to edit text on a website, so I fill the form input areas with the fields from the appropriate table. But, when using <input type="textarea", etc. etc., the form simply shows as <input type="text"> Is there a special label that I should be using so that the input area that is populated with data from a database field shows up as an html textarea? echo '</label><input type="textarea" name="order" value = "' . $row['order'] . '" rows = "5" cols = "50"/><br />'; Link to comment Share on other sites More sharing options...
thescientist Posted November 21, 2010 Share Posted November 21, 2010 i think the tag itself is just a textarea taghttp://www.w3schools.com/TAGS/tag_textarea.asp Link to comment Share on other sites More sharing options...
jeffman Posted November 22, 2010 Share Posted November 22, 2010 To clarify. The default type for an input is "text". It would seem that when your browser does not recognize the value specified in the type attribute, it falls back on the default. Link to comment Share on other sites More sharing options...
End User Posted November 22, 2010 Share Posted November 22, 2010 Textarea tags need to be closed, and no "type" is needed. They also don't take a "value" param:<textarea name="order" rows = "5" cols = "50"/>$row['order']</textarea> I need to allow a user to edit text on a website, so I fill the form input areas with the fields from the appropriate table. But, when using <input type="textarea", etc. etc., the form simply shows as <input type="text"> Is there a special label that I should be using so that the input area that is populated with data from a database field shows up as an html textarea?echo '</label><input type="textarea" name="order" value = "' . $row['order'] . '" rows = "5" cols = "50"/><br />'; Link to comment Share on other sites More sharing options...
Fmdpa Posted November 22, 2010 Share Posted November 22, 2010 And yes, you can use the "rows" and "cols" attributes, but I prefer using CSS width/height, because the rows and cols for a textarea will vary depending on the web browser. Using the CSS width and height properties will keep it the same size regardless of the browser. Link to comment Share on other sites More sharing options...
Ingolme Posted November 22, 2010 Share Posted November 22, 2010 And yes, you can use the "rows" and "cols" attributes, but I prefer using CSS width/height, because the rows and cols for a textarea will vary depending on the web browser. Using the CSS width and height properties will keep it the same size regardless of the browser.I use CSS to style them too, but the rows and cols attributes are required. The validator will show an error if you don't have those attributes. Link to comment Share on other sites More sharing options...
lauralee Posted November 23, 2010 Author Share Posted November 23, 2010 Thanks. That works! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.