1) don''t use start_form_tag and end_form_tag -> they''ve
been
deprecated. Use form_tag or form_for instead.
2) when/how do you want to reset the text field? Do you want to have a
button that the user can press to reset the text field? If so, you
can use javascript to do this..
3) what do you mean "retain the values"? Retain them where? Store them
to a database? Keep the values in the text fields if the user submits
a form with errors? Please elaborate.
Adam
On 7/20/07, Niaz Arifin
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hi,
> I apologize if this appears to be too elementary and answered before.
> I need to reset a text_field (named as ''server_name'') in
my controller.
> The relevant controller code is:
> <%= start_form_tag :action => ''search''%>
> <%= text_field :server, :server_name, :size => 15 %>
> <%= submit_tag ''Search'' %>
> <%= end_form_tag %>
>
> Also, I need to retain the values typed by the user in the above text
> field.
> Could anybody help on how to do these?
> Thanks in advance.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---