how to get the value of a text field

Hi everyone,

I need to get the value of one text field when clicking "next page". My code looks like:

this is the view page:   <% form_tag('javascript:void(0)') do %>

    <%= text_field_tag 'search' %>

    <%= observe_field :search,                       :frequency => 0.5,                       :update => 'my_friends',                       :url => {:action => 'search'},                       :with => "'search=' + encodeURIComponent (value)" %>   <% end %> <% end %>

<div id="my_friends"> <% @friends.each do |friend| %>   <%= friend.name %> <% end %> <%= will_paginate @friends, :params => {:search => ??? } %> </div>

The problem is: I dont know how to pass the value of the search text field to <%= will_paginate @friends, :params => {:search => ??? } %>. Can anyone help me out??

thanks xiahong