Desiging HTML forms [duplicate]
Possible Duplicate:
Autosizing Textare开发者_开发百科a
Hi,
I have developed a web form where one field is description. I want that field to be bigger in size, so that users can see the full description. How do I do that?
Thanks
What type of fields are you using? are you using input fields for the the description or have you used textarea's?
If you are using inputs rather use <textarea cols="100" rows="5" id="yourID" name="yourNAME"></textarea>
If you want to give a text area a specific width and height then I would recommend using style rather than cols
or rows
.
This is because different browsers will give different widths and heights with cols
and rows
.
To be as consistent as possible across multiple browsers you can use something like:
<textarea name="myTextarea" style="width: 300px; height: 200px;"></textarea>
Or to keep the HTML cleaner you could use:
<style type="text/css">
.myTextarea {
width: 300px;
height: 200px;
}
</style>
<textarea name="myTextarea" class="myTextarea"></textarea>
If however I have mis-understood and you want the textarea to automatically grow in size, you would need to use javascript, or better yet something like jQuery, and the use of rows/cols would become much more important.
精彩评论