lunaclaire wrote:
> II'm switching to jQuery and wondering how do I pull the onchange:
> stuff out of the following for a select and put it into a handler?
> 
> here's what I have in my view now:
> 
> <%= select_tag :selected_email,
>    options_from_collection_for_select(update_request.contact.emails,
> 'id', 'value', update_request.contact.primary_email_id),
>   :onchange => remote_function(:url => {:action
> => :set_request_email, :id => update_request.id}, :with => "'value=' +
> value"),
>   :id => "request_email_#{update_request.id}" %>
$("#your_select_id").live("change",function(event){
   //It return whatever value is selected
   value_of_select =$("#your_select_id").val();
//Now call ajax request on change
//You can refer code http://railstech.com/?p=58
});
Refer Code http://railstech.com/?p=58
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to