If I include this in a php file, it works nicely.
<body>
<?php include "myfirstgrid.php" ?>
</body>
</html>
I want to use a select box to choose an item from a list then call the jqgrid php file "myfirstgrid.php". The select works perfectly, calling "squdrons.php" and populating the select list. When the select chooses an item (which works) I want to fill "#bot" with the jqgrid (which doesn't work). The reason for the select list is I want to modify what "myfirstgrid.php" sends back from the server based on the selection. This is what I currently have which doesn't populate "#bot" with the jqgrid.
<body>
<select size="1″ id="squadronList">
<option>Select a Navy squadron</option>
<?php include "squadrons.php" ?>
</select>
<div id="top"></div>
<div id="bot"></div>
<script type="text/javascript">
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str = $(this).val();
$("#top").text(str); // this works
});
})
.change();
</script>
<script>
$("#squadronList").bind("change", function() {
var uic = $("#squadronList").val();
$("#bot").text(function() {
$.get("myfirstgrid.php");
});
});
</script>