Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make text area not resizeable

I'm using a form in Rails with a text area. This is good, except that the text area is resizable by the user. I don't want the user to be able to resize it. How can I do that?

<%= form_tag "doit", :id => "doit_form" do -%> 
  Names <br/>
  <%= text_area_tag "names", nil, :rows => 4, :cols => 50 %> <br/>
  Date <br/>
  <%= text_field_tag "date" %> <br/>
  <%= submit_tag "Do it!" %>
<% end -%>
like image 920
Mika H. Avatar asked Jan 14 '23 11:01

Mika H.


1 Answers

Use CSS:

textarea { resize: none; }

Works with most browsers. Older browsers don't have the handle to resize textarea fields so then it shouldn't be a problem anyway.

like image 147
jtheman Avatar answered Jan 22 '23 20:01

jtheman