Tuesday, December 7, 2010

Send Ajax request after Auto Complete text box - after_update_element

Continuation for my previous post about Auto complete plugin

I have used after_update_element to send the value that is selected in the Auto complete

<%= text_field_with_auto_complete 'phonenumber', 'to',{:size=>25, :class=> "text ui-widget-content ui-corner-all", :value=>@service_order.phonenumber}, {:skip_style => false, :after_update_element=> "function(element,value){new Ajax.Request('/controller/action', {asynchronous:true, evalScripts:true, method:'get', parameters:'number=' + $('phonenumber_to').value }); return false;
}"} %>

1 comment:

Unknown said...

This is an excellent site that is good for anyone wanting to learn

the basics of progamming on the Internet. It prepares you with

everything you need to know before jumping into advanced languages.

Great web site too for additional info.

java training