I have seen it on some sites where the textarea input can by drawn only downward but not to sideways.
<textarea cols="10" rows="5" charswidth="23" name="text_body"></textarea>
To prevent a text field from being resized, you can use the CSS resize property with its "none" value. After it you can use the height and width properties to define a fixed height and width for your <textarea> element.
A simple way to ensure that the control is not resizable is to add an explicit style="resize: none;" attribute on the textarea element using the HTML Form Element Attributes property.
It can be achieved by using JavaScript and jQuery. Method 1: Using JavaScript: To change the height, a new function is created which changes the style property of the textarea. The height of the textarea is first set to auto. This value makes the browser set the height of an element automatically.
textarea { resize: vertical; }
<textarea cols="10" rows="5" charswidth="23" name="text_body"></textarea>
JSFiddle Demo
This can be achieved via CSS.
<textarea cols="10" rows="5" charswidth="23" name="text_body" style="resize:vertical"></textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With