<input class="FormElement" name="term" id="term" type="text">
What modifications should I do to this textbox to make it multiple line, without the need to modify anything else i开发者_如何学运维n the code, like reading its value.
I used to read the input by javascript like that, what should be changed in that as well?
var $term = $("textarea#term").val();
You need a <textarea>
with the same name
, so replace this:
<input class="FormElement" name="term" id="term" type="text">
With this:
<textarea class="FormElement" name="term" id="term" cols="40" rows="4"></textarea>
The rows
and cols
arguments are the width/height respectively...or use CSS styling to specify the size, like this:
<textarea class="FormElement" name="term" id="term" style="width: 200px; height: 40px;"></textarea>
精彩评论