I have a select tag, where users can select what TYPE of exposure they want for their clicks:
<select name="exposure">
<?php while($a = mysql_fetch_assoc($r)): ?>
<option value=""><?php echo $a['exposure']; ?></value>
<?php endwhile; ?>
</select>
Below that, I have another select tag, that will show the clicks with value taken from whatever exposure type they chose:
<select name="clicks">
<?php while($a = mysql_fetch_assoc($r)): ?>
<option value=""><?php echo $a['amount']; ?></value>
<?php endwhile; ?>
</select>
My question is: How can I change the value in the second select tag, according to whatever the user has chosen in the first?
This shouldn’t be too difficult. All you really need is a mapping between ‘exposure’ values and ‘clicks’ values, and some way to turn the ‘clicks’ values into valid markup. You can play around with the example below on jsFiddle: http://jsfiddle.net/ninjascript/5QPq5/
Edit: jQuery.live() will execute a function whenever an event occurs. You can do whatever you want within that function, including change the contents of multiple DOM elements.