I have a page with a form with two html select tags. The first html select tag is populated with data from php.
<select name="groep" id="groep">
<?php
for ($i = 0; $i < $aantal; $i++) {
echo "<option value='" . $groepen[$i] . "'>" . $groepen[$i] . "</option>";
} ?></select>
The second html select tag is populated with data based on the selection from the first html select tag (with a on('change') jquery function on the first html select tag).
<select name="school"><option>Selecteer eerst de groep.</option></select>
-
$(document).on('change', '#groep', function() {
var str = "";
$( "#groep option:selected" ).each(function()
{
str += $( this ).text() + " ";
});
var url = "../getSchools.php?q=" + $( "#groep option:selected").text();
$( "td#schoolselect" ).load( url );
});
Now i want both selected values from both select tags written to my mysqldb. Problem is that the selected value from the second select tag isn't getting passed when submitted.
What could be my problem?