Re: ajax.updater with select tags
thanks. that was basically the solution. more here: http://groups.google.co.uk/group/rubyonrails-spinoffs/browse_thread/thread/f6803b57209ca66e/?hl=en# On 5 Mar, 19:52, "Krang" <[EMAIL PROTECTED]> wrote: > create a js function "getSelected()" --this would be a simple "return > document.getElementById(***).value" > > get your updater url to be " \'ships?variable=\'+getSelected() " > > Hope that helps > > On Mar 5, 8:21 am, "lukemack" <[EMAIL PROTECTED]> wrote: > > > hi, > > > i am trying to make the contents of one drop-down box dependent on the > > contents of another using AJAX (prototype.js) in cake 1.1.13. > > > I have it working so that a new dropdown appears when i select a value > > in the first dropdown: > > > selectTag('Review/cruiseline', $cruise_lines, null, > > array('onchange'=>'new Ajax.Updater(\'test\', \'ships?variable=12\', > > { method: \'get\' }, {asynchronous:true, evalScripts:true});'), null, > > true, false);?> > > > In my controller, I am just getting the value of 'variable' from the > > $_GET super global but I obviously want that value to be dynamic and > > equal to the value selected in the dropdown. > > > So the missing piece is passing the selected dropdown value to the > > controller. Anyone know how to do that? > > > thanks, > > > lukemack. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ajax.updater with select tags
create a js function "getSelected()" --this would be a simple "return document.getElementById(***).value" get your updater url to be " \'ships?variable=\'+getSelected() " Hope that helps On Mar 5, 8:21 am, "lukemack" <[EMAIL PROTECTED]> wrote: > hi, > > i am trying to make the contents of one drop-down box dependent on the > contents of another using AJAX (prototype.js) in cake 1.1.13. > > I have it working so that a new dropdown appears when i select a value > in the first dropdown: > > selectTag('Review/cruiseline', $cruise_lines, null, > array('onchange'=>'new Ajax.Updater(\'test\', \'ships?variable=12\', > { method: \'get\' }, {asynchronous:true, evalScripts:true});'), null, > true, false);?> > > In my controller, I am just getting the value of 'variable' from the > $_GET super global but I obviously want that value to be dynamic and > equal to the value selected in the dropdown. > > So the missing piece is passing the selected dropdown value to the > controller. Anyone know how to do that? > > thanks, > > lukemack. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ajax.updater with select tags
hi, i am trying to make the contents of one drop-down box dependent on the contents of another using AJAX (prototype.js) in cake 1.1.13. I have it working so that a new dropdown appears when i select a value in the first dropdown: selectTag('Review/cruiseline', $cruise_lines, null, array('onchange'=>'new Ajax.Updater(\'test\', \'ships?variable=12\', { method: \'get\' }, {asynchronous:true, evalScripts:true});'), null, true, false);?> In my controller, I am just getting the value of 'variable' from the $_GET super global but I obviously want that value to be dynamic and equal to the value selected in the dropdown. So the missing piece is passing the selected dropdown value to the controller. Anyone know how to do that? thanks, lukemack. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---