Forum: Ruby on Rails Rails, Ajax, and the back button

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5cd805eda9338f43deaa498a22588a9f?d=identicon&s=25 Desert Penguin (desertpenguin)
on 2007-04-25 00:24
When I go back to a page with a form, the text field fails to retain a
value.  It was created with text_field_with_auto_complete.  I want it to
retain the value entered previously.

Thanks in advance for any help...

Details:

I have a form created with
<% form_for :quote, :url => { :action => :myaction} do |form|%>

within the form I have an ajax field for another model

  <% fields_for :classification do |classification| %>
  <tr><td>Classification:</td><td> <%= text_field_with_auto_complete
:classification, :class_desc , :skip_style => true, :size => 60
%></td></tr>
  <% end %>

Unfortunately, this field gets reset with the back button.

Thanks again for any help - it is driving me nuts
72ea925c0ca3d19fdd2f12fa76681624?d=identicon&s=25 Stephan Wehner (stephanwehner)
on 2007-04-25 02:00
Desert Penguin wrote:
> When I go back to a page with a form, the text field fails to retain a
> value.  It was created with text_field_with_auto_complete.  I want it to
> retain the value entered previously.
>
> Thanks in advance for any help...
>
> Details:
>
> I have a form created with
> <% form_for :quote, :url => { :action => :myaction} do |form|%>
>
> within the form I have an ajax field for another model
>
>   <% fields_for :classification do |classification| %>
>   <tr><td>Classification:</td><td> <%= text_field_with_auto_complete
> :classification, :class_desc , :skip_style => true, :size => 60
> %></td></tr>
>   <% end %>
>
> Unfortunately, this field gets reset with the back button.
>
> Thanks again for any help - it is driving me nuts

If you look at the HTML source generated, does the input field have a
tag

  autocomplete="off"


I think that may be your problem. Try to see how you can get rid of
that.

Stephan
This topic is locked and can not be replied to.