Simple javascript

Hi,

....
... <%= text_field_tag :search, params[:search], :id=>"search_field", :value=>params[:search] %> ...

Just wondering how I would clear the value for the text_field_tag,

Thanks!!

Justin To wrote:

Hi,

....
... <%= text_field_tag :search, params[:search], :id=>"search_field", :value=>params[:search] %> ...

Just wondering how I would clear the value for the text_field_tag,

Thanks!!

if you were using a form_remote_tag you could always say :complete =>
‘document.getElementById(“search_field”).value = “”’

<% form_remote_tag update => “id_of_div_to_update”, :url => { :action =>
:method_call}, :complete=>
‘document.getElementById(“search_field”).value = “”’ do -%>

<% end ->

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs