I have javascript code that fires once I select from first drop down:
$(document).ready(function(){
$("#first-choice").change(function() {
$("#second-choice").load("getter.php?choice=" + $("select#first-choice").filter(":selected").val());
});
});
I think the problem lies when I create the getter.php extension... Which I use choice in my sql. Choice is defined in getter.php as:
$choice = $_GET['choice'];
$sth = $db->prepare("SELECT name, code FROM sets WHERE name='$choice'");
$sth->execute();
$choicecode = $sth->fetchColumn(1);
When the javascript change fires I get an empty drop down. So I tested by setting Choice equal to one first-choice options, instead of $_GET, and the second list populated correctly. So I'm assuming my error comes from my js by defining the selected first choice.
getter.php? Where do you render the new select? It looks like there is no output from this file at all.