So I have the following code at the moment:
<form action="">
<div id="term"><select name="s2" >
<option name="" value="">--Select Term--</option>
</select></div>
<div id="dept"><select name="s3" >
<option name="" value="">--Select Department--</option>
</select></div>
<div id="course"><select id='selCourse' value="">
<option name="" value="">--Select Course--</option>
</select></div>
<div id="sec"><select id='selSec' value="">
<option name="" value="">--Select Section--</option>
</select></div>
<script>
$('#term').load('fetchcourses.php?');
alert('It Works');
</script>
<script>
$('[name=s2]').change(function() {
$('#dept').load('fetchcourses.php?term='+$(this).val());
});
</script>
It works as it, however, if I remove the alert('It Works') the code will load the data correctly for the first line, but nothing happens for .change().
I've looked at similar issues on here and other places, and apparently it has to do with asynchronous code? However, I don't really understand what that means, or how to resolve it. Any help is appreciated!