html - Rails - turn off autocomplete for text_field and password -


i give up. have remembered password , login phpmyadmin on www.xxx.com/phpmyadmin like:

root asdfasfsdfs 

then on aplication on www.xxx.com/model/new , have

<%= form_for @model |f| %>   <%= f.text_field :city, :placeholder => 'write city' %>  <%= f.password_field :password, :placeholder =>'set password' %>   <% end %> 

why browser put in text_field city "root" , in password - password root of phpmyadmin?

how can remove autocomplete of fields? try:

 autocomplete => 'off'  autofocus => false  :value => ''  $('#field').val('') 

nothings work... peoples not see placeholder text, because fields filled ...

answer:

ok, make jquery, this:

$(window).load(function(){     $('.div_class input').val('')  }); 

so fields filled after load done jquery clear them.

just change syntax little. worked me :autocomplete => :off

<%= f.text_field :city, :placeholder => 'write city', :autocomplete => :off %> 

Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -