Sie können diese mit AJAX tun. Ich reiche ein Beispiel ein, das Sie entsprechend ändern können.
<div>
<select id="c_source" name="source">
<option value="option1">option1</option>
<option value="option2">option2</option>
</select>
</div>
<div>
<select required id="c_destination" name="city">
</select>
</div>
Ajax-Aufruf
<script>
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
$("#c_source").change(function(){
$.ajax({
type: "GET",
url: $SCRIPT_ROOT + "/getdest/"+$("#c_source").val(), //Here you can call any api or backend link where you provide the connection for the details where they can be extracted
contentType: "application/xml; charset=utf-8",
success: function(data) {
$('#c_destination').empty();
var jsonObj = JSON.parse(data);
$.each(jsonObj['result'], function(key, value) {
$('#c_destination').append($('<option></option>').attr('value', value).text(value));
});
},
error: function(jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
</script>
sehr breit, Können Sie bitte geben Sie mir ein Beispiel. Vielen Dank. –
Angenommen, ich habe get_date.php, wie die zweite Auswahl zu füllen? –