Thread Starter
ragos
(@ragos)
Thanks for the answer.
You’re saying I can’t use something like an eventHandler to see if the ‘select’ element changes?
Why can’t I do something like:
document.getElementById('select-2-field').addEventListener('change', function_name,
false);
I’ve already accomplished changing/selecting an option from the other ‘select’ element, now I want to do that when the first ‘select’ element changes. That’s why I was trying with an eventHandler with it’s ID, but it’s not working
Thanks again for the answer
Thread Starter
ragos
(@ragos)
Update: I’m trying this now, which I think it’s supposed to work, but it doesn’t…
<script>
jQuery(document).ready(function() {
jQuery("#select-2-field").change(function() {
var val = jQuery(this).val();
jQuery("#select-3-field").val(val);
});
});
</script>
I just want to update the value of a select element, based on the previous select element.
-
This reply was modified 4 years, 10 months ago by ragos.