prototype.js and Ajax.Updater

L

lukemack

hi,

i am trying to make the contents of one drop-down box dependent on the
contents of another using AJAX (prototype.js) and PHP

I have it working so that a new dropdown appears when i select a value
in the first dropdown:

<?php echo $html->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 php script (which is located at URL 'ships'), 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 from
HTML / Javascript to PHP. Anyone know how to do that?

thanks,

lukemack.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top