I have a reservation form. In case if one of my customers fall into a problem, I want them to call me in a time that they prefer. For that, I have created two drop down list boxes. First combo box should contain two options (as given in the snippet) with Call today selected by default. If second option Call Tomorrow is chosen, the second drop-down list should be filled with the available time slots like:
12:00
13:00
16:00
20:00
...
...
and so forth. How could this be achieved?
$("#call-day").change(function(e){
val=$("option:selected",this).val();
if(val=="today"){
}else if(val=="tomorrow"){
}
});
<select name="call-day" id="when-ajax">
<option class="today">Call Today</option>
<option class="tomorrow">Call Tomorrow</option>
</select>
<select name="hours">
<option>Call Now</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>