passing multiple parameter through observe_field


Im trying to search through multiple parameters through observe_field.

Following is my code.: its not showing any result, kindly help..

<label for="dev_name">Filter on Device Name : </label>
<input id="search" name="search" type="text" value="">
<label for="dev_platform">Filter on platform : </label>
<input id="search1" name="search1" type="text" value=""></form>

<%= image_tag("spinner.gif",
              :align => "absmiddle",
              :border => 0,
              :id => "spinner",
              :style =>"display: none;" ) %>

<%= observe_field 'search', :frequency => 2,
         :update => 'table',
         :before => "'spinner')",
         :success => "Element.hide('spinner')",
         :url => {:action => 'trackLocation'},
         :with => "'search='+ escape($('search').value) + '&search1=' +

<div id="table">
<%= render :partial => "devices_list" %>

and controller looks like:

def trackLocation
conditions = ["name LIKE ?", "%#{params[:query]}%"] unless

@devices=Dev.find(:all,:conditions=>["name LIKE ? and platform LIKE ?",

#@devs_pages, @devs = paginate :devs, :conditions => conditions, :per_page
=> devs_per_page
if request.xml_http_request?
   render :partial => "devices_list", :layout => false

This also dint helped… basically i want to search through both the parameters . …

Supriya Agarwal wrote:

This also dint helped.. basically i want to search through both the
parameters . ..

On Wed, Jun 18, 2008 at 3:11 PM, Suneeta Km <

You can pass the value of the element you are observing. what do u mean
by escape(value)?