Menu icon Foundation
Default Height For Textarea

This may very well be a simple fix, but I figured I would go ahead and ask the forum. I am making a "Contact Us" form and want to have a text area for comments/questions. I like how the textarea can be resized by the user, but I need it to begin at a certain height, so users don't have to resize it as they go. Ideally, I would either like the text area to be big enough for the average question, or have it to where the size increases as the user types. Any advice on this would be great. I'd also like it to be required with a error message if they leave it blank. Just working with the form code found on this page, not exactly sure how to customize it to my needs. Any ideas?

http://foundation.zurb.com/docs/components/forms.html

heighttextarea

This may very well be a simple fix, but I figured I would go ahead and ask the forum. I am making a "Contact Us" form and want to have a text area for comments/questions. I like how the textarea can be resized by the user, but I need it to begin at a certain height, so users don't have to resize it as they go. Ideally, I would either like the text area to be big enough for the average question, or have it to where the size increases as the user types. Any advice on this would be great. I'd also like it to be required with a error message if they leave it blank. Just working with the form code found on this page, not exactly sure how to customize it to my needs. Any ideas?

http://foundation.zurb.com/docs/components/forms.html

Rafi Benkual almost 6 years ago

Here is how to size it with css. (you can use pixels as well)
http://cdpn.io/HkCgf

To have textarea respond to content, you can do it with JS plugins like:
http://www.impressivewebs.com/textarea-auto-resize/

Check out this article for more textarea tricks: http://css-tricks.com/textarea-tricks/

guillermo haas-thompson almost 6 years ago

This problem is present in both Foundation 4 and 5. Simple fix on this thread allows row height declaration to work again. https://github.com/zurb/foundation/issues/2127

Not sure why the issue was closed since the the textarea height bug still exists.

Rafi Benkual almost 6 years ago

The issue you are referring to is not exactly related to the question. Can you post your code so we can test it?