First off my problem: I want to populate drop down boxes based on what the user has picked. I know very little JS and i've always just coded everything in php/sql.Secondly, I know you can't run a PHP snippet based on a user's input. The only way is to resubmit the page using a JS script off the OnChange().I've google the hell out of this and found some mediocre explanations. Figured i'd try TWW last resort.I'll try to keep the code minimal. my first SQL query fill outs of the first box:
$sql = "SELECT carID, carName FROM car ORDER BY carGrossPower";
$sqlTyres = "SELECT * FROM tires2cars LEFT JOIN tires ON (ttTireID = carID) WHERE ttCarID = '".$val['myCarID']."'";
<select name="cars" class="form" style="width:200px" onchange="thisiswhereimstuck"> <option value=""> Select Cars</option> {html_options options=$CarName selected=$myCarID </select>
<select name="cars" class="form" style="width:200px" onchange="thisiswhereimstuck"> <option value=""> Select Tires</option> {html_options options=$myTires selected=$myTiredID </select>
10/14/2009 8:49:12 AM
http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/
10/14/2009 9:18:18 AM