I can get this popup to return the proper value when I type the actual var choice in to the url that exists in the database.
<script type="text/javascript">
var data = $.get("logbookincludes/sqftpoles.php?choice=Front Range", function(data) {
alert("Data Loaded: " + data);
});
</script>
I want the variable to be set by the actual dropdown selector id. I can't seem to get the syntax correct.
var data = $.get("logbookincludes/sqftpoles.php?choice=" + $("#item36_select_1").val());
Here's the server side php to fill the selector dropdown.
zones.php
<?php
include("dbinfo.php");
$query = "SELECT zonename FROM zone";
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) {
echo "<option>" . $row{'zonename'} . "</option>";
}
?>
Here's the dropdown code.
Zone
<select name="zone" id="item36_select_1" required data-hint="">
<option id="item36_0_option" selected value="Front Range">
Front Range
</option>
<? include('logbookincludes/zones.php');?>
</select>
Here's the sqftpoles.php
<?php
include("dbinfo.php");
$choice = mysql_real_escape_string($_GET['choice']);
$query = "SELECT sqftpoles FROM zone WHERE zonename = '$choice'";
$result=mysql_query($query);
$result2=mysql_query($query2);
while ($row=mysql_fetch_array($result)) {
echo $row{'sqftpoles'};
}
?>