I''ve got this code below. <script type="text/javascript" src="../../prototype.js"></script> <script type=''text/javascript''> Event.observe(window, ''load'', init, false); function init(){ var url = ''supadjustment.php''; var supformlist = Form.serialize(''supform''); var pars = supformlist; var target = ''supervisoradjustments''; var myAjax = new Ajax.Updater(target, url, {method: ''get'', parameters: pars}); } </script> <div id=''supervisoradjustments''></div> It works fine. What i''m wondering is, when it dumps everything back into the div tag, is there a way I can use the variables it returns? For example, on the page called supadjustment.php it looks up a list of names and dumps them, in a <form> <select>, onto the main page through the div tag. How can I then access the values of the list? I want to give those values to another page to lookup data specific to the person selected. I want to take the response and put it into a php variable so that I can do something else with it, rather than just dumping the results into a div tag. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
give the list an id or class: <select id="results" ..... var values = $A($(''results'').options).pluck(''value''); //for just the current selected value i think $F(''results''); would work --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I think you might be getting your client server logic confused. If you''re looking to evaluate the XHR''s responseXML or responseText properties you should use the Ajax.Request class instead of Updater which auto injects responseText into the element''s innerHTML property. With Ajax.Request no element is directly modified but you''re able to update things manually by working with the XHR in a function callback. I take it you''re working with PHP on the back end, if you think about it, the responseText is a PHP String that gets outputted by the server side script that the client''s XHR objects are connecting to. If you want to manipulate the data in PHP it must be done upon the request and sent to the client in a string. On Aug 8, 11:18 am, jdalton <jdalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> give the list an id or class: <select id="results" ..... > > var values = $A($(''results'').options).pluck(''value''); > > //for just the current selected value i think > $F(''results''); would work--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---