views:

12

answers:

1

Here, In my code I have to put one of the text_area and i have to put some certain condition over them. Code which was used by me. Ruby Code::

    <%= text_area "rate_unit","rate_unit_notes", "rows" => 3, "cols" => 50,
:tabindex=>3, :maxlength=>100 %>

HTML Code after executing the page

    <textarea tabindex="3" rows="3" name="rate_unit[rate_unit_notes]" maxlength="100"
 id="rate_unit_rate_unit_notes" cols="50"></textarea>

But issue is that maxlength option is not working. Name of condition which i want to applied on this textarea :: maxlength, size, class, autocomplete. Suggest me ..

A: 

There are no technique in HTML to do that with text_area. The limit number of character exist only on input[text].

So you can block this limit with Javascript by example. But in each case, nothing avoid user to put more than 100 character. So you need validate in your server side, that are not more than 100 characters.

shingara