开发者

ROR + How to make Textarea with few conditions of validation and property

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, "c开发者_运维百科ols" => 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 ..


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜