Hello, im looking for a solution to change a set of select options that are from a mssql db with a different set of options created by a different query. I realize there alot javascript involved but after searching this forum and js forums i was unable to come up with a solution.
As is stands right now i have the list menu setup for one query but i want to change the query with a checkbox. I believe you would do that but first having the two queries create var and have the checkbox use onChange to change which var is used, is that correct?
Any link or help is greatly appreciated, Thanks in advance.
Heres the current select menu
<?php
$joblist_query = "SELECT jobnumber FROM job
WHERE (complete_yn = 0 AND jobnumber BETWEEN 1 AND 9999)
ORDER BY jobnumber";
$joblist_results=mssql_query($joblist_query);
echo '<select name=joblist onchange="document.report.jobnumber.value = document.report.joblist.options[document.report.joblist.selectedIndex].value;submit();" class=reportSelect>' . "\n";
while ($row = mssql_fetch_array($joblist_results))
{
extract ($row);
$activejob = htmlspecialchars(stripslashes($row[0]." ".$row[1]));
echo '<option value='. $jobnumber .'>' . "$activejob" . "</option>";
}
echo '</select>' . "\n"
?>
My second query should look like this
$joblist_query = "SELECT jobnumber FROM job
WHERE (complete_yn < 2 AND jobnumber BETWEEN 1 AND 9999)
ORDER BY jobnumber";