dataType: 'json', // Choosing a JSON datatype }) .done(function(data) { // Variable data contains the data we get from serverside $('#num' + index).html('<option selected="selected">Course Number</option>'); for (var i in data) { console.log(i); $("#num" + index).append($('<option></option>').attr('value', data[i].id).text(data[i].department + data[i].number + (data[i].title.length > 0 ? " (" + data[i].title + ")" : "" ))); } }); return false; }); }); </script> <form method="POST" action=""> <?php $courses = get_registered_courses($account); if (count($courses) == 0) { ?> <div id="input1" class="clonedInput"> <select name="dep1" id="dep1"> <option selected="selected">Course Department</option> <?php $depts = get_departments_in_college($college["id"]); foreach ($depts as $d) { echo "<option value=\"" . $d . "\">" . $d . "</option>"; } ?> </select> <select name="num1" id="num1"> <option selected="selected">Course Number</option> </select>
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); require_once "includes.php"; $title = "Home"; require_once "header_home.php"; if ($account === false) { require_once "login.php"; } else { if (count(get_registered_courses($account)) > 0) { require_once "home.php"; } else { header("Location: /" . SITE_ROOT . "/select"); } } ?> <?php require_once "footer.php";