I have two different methods that I want to execute when a user clicks a button. I have them working separately, but when I try to combine the two I get errors. The two ones I have currently are
<%= image_tag('go_button.png',
:id => "search_go_button",
:class => "search_go_button",
:onmouseover => "this.style.cursor='pointer';",
:onmouseout => "this.style.cursor='default';",
:onclick => "if ($(\"input_search_field\").value!=\"\" && $(\"input_search_field\").value!=\"Search Places\") {#{
remote_function(:update => "right_nav;",
:url => { :action => :search_places },
:with => "'search_text='+$('input_search_field').value+'&search_radius='+$('radius').innerHTML",
:before => "Element.show('search_spinner'); Element.hide('search_go_button');",
:success => "Element.hide('search_spinner'); Element.show('search_go_button');")
}}") %>
and
:onclick => "collapse_reset(this); new Ajax.Request('/places/search/#{cat.id}?search_radius='+$('radius').innerHTML,{asynchronous:true, evalScripts:true}); {#{remote_function(
:update => "localads;",
:url => { :action => :get_ads,
:id => cat.id },
:before => "Element.show('ad_search_spinner'); Element.show('ad_search_spinner1'); Element.show('ad_search_spinner2'); Element.hide('ad1'); Element.hide('ad2'); Element.hide('ad3'); if($('ad1_slide_down_wrap').style.display != 'none'){$('ad1_slide_down_wrap').style.display = 'none';} if($('ad2_slide_down_wrap').style.display != 'none'){$('ad2_slide_down_wrap').style.display = 'none';} if($('ad3_slide_down_wrap').style.display != 'none'){$('ad3_slide_down_wrap').style.display = 'none';}",
:success => "Element.hide('ad_search_spinner'); Element.hide('ad_search_spinner1'); Element.hide('ad_search_spinner2'); Element.show('ad1'); Element.show('ad2'); Element.show('ad3');") }}",
:href => "/places/navigate/#{cat.id}" } %>
I basically want add the function from the bottom one to the top one. Any help would be greatly appreciated.