0

i still try in rails 3.2 to use bootstrap typeahead, it works fine, but how can i avoid users to type anything in text field.
I code looks like this

<%= text_field_tag(:text, "", :data => {:provide => "typeahead", :items=>"4", :source=>'["Swiss","German","English"]'}) %>  

users may only type Swiss, German and English in the text field, but not for example Chinese.
How can i validate the value in text field?

4

1 回答 1

0

Set tag attribute disabled="disabled"

于 2012-12-10T21:33:17.883 回答