fakdora
2009-Feb-24 05:28 UTC
How do I clear values from text_field_tag after browser refresh????
Hi all, I''m having an issue with text_field_tag. I want to reset the value of the text_field when I refresh my browser, seems like a very simple thing, however I''m having hard time finding the answer. After I input some values, how do i reset the value to nil or empty?? my code is below <%= text_field_tag ''login'', @login, :class => "input-text", :onblur => "loginFieldOnBlur(''login'')", :onfocus => "loginFieldOnFocus(''login'')" %> Any help or tip will be greatly appreciated. I tried removing @login from text tag, setting @login to null or empty..setting params[:login] to an empty string in my session controller...but nothing seems to be working.. Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Salil Gaikwad
2009-Feb-24 08:01 UTC
Re: How do I clear values from text_field_tag after browser refresh????
You can try this.. <%= text_field_tag ''login'', @login, :class => "input-text", :value=>"" %> fakdora wrote:> Hi all, > > I''m having an issue with text_field_tag. I want to reset the value of > the text_field when I refresh my browser, seems like a very simple > thing, however I''m having hard time finding the answer. > > After I input some values, how do i reset the value to nil or empty?? > > my code is below > <%= text_field_tag ''login'', @login, :class => "input-text", > :onblur => "loginFieldOnBlur(''login'')", > :onfocus => "loginFieldOnFocus(''login'')" > %> > > Any help or tip will be greatly appreciated. > > I tried removing @login from text tag, setting @login to null or > empty..setting params[:login] to an empty string in my session > controller...but nothing seems to be working.. > > 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 -~----------~----~----~----~------~----~------~--~---