Jump to content

DSTR3

Members
  • Posts

    53
  • Joined

  • Last visited

Everything posted by DSTR3

  1. Thank you for your response. Since I am completely new to all of this, I don't quite understand what you mean about $list. I see what you mean, It was cut off! Adding it here. Also where would I place the ERROR? <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8" /> <title>Dependable dropdown menu</title> <meta name="description" content="Dependable dropdown menu" /> <meta name="keywords" content="Dependable dropdown menu" /> <link href="/BigStuff/css/core.css" rel="stylesheet" type="text/css" /> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <div align="center"> <select name="Place" size="25" id='Place' class="update"> <option value="">Select one</option> <?php if (!empty($list)) { ?> <?php foreach($list as $row) { ?> <option value="<?php echo $row['RestID']; ?>"> <?php echo $row['RestName']; ?> </option> <?php } ?> <?php } ?> </select> <select name="City" size = "25" id="City" class="update" disabled="disabled"> <option value="">----</option> </select> <select name="Area" size="25" id="Area" class="update" disabled="disabled"> <option value="">----</option> </select> </div> </form> </div> <script src="/BigStuff/js/jquery-1.6.4.min.js" type="text/javascript"></script> <script src="/BigStuff/js/core.js" type="text/javascript"></script> </body> </html>
  2. Oooops. Forgot to add this! core.js var formObject = { run : function(obj) { //if (obj.val() === '') { obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true); //} else { var id = obj.attr('id'); var v = obj.val(); jQuery.getJSON('/BigStuff/mod/update.php', { RestID : RestID, value : v }, function(data) { if (!data.error) { obj.next('.update').html(data.list).removeAttr('disabled'); } else { obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true); } }); //} } }; $(function() { $('.update').live('change', function() { formObject.run($(this)); }); });
  3. I have a series of three listboxes. The first one is working, however the next two refuse to update after clicking on the first one! My table structure is as follows. tblRestaurants RestID, RestName, RestStatus tblLocations RestID, LocationID, CityID, AreaID tblCities CityID, CityName tblAreas AreaID, AreaName The first listbox gives the restaurants, the second the given city(s) that they are in, and third the Area(s) of the city they are in. Here is the main page..... index.PHP <?php try { $objDb = new PDO('mysql:host=MyHead.db.5513143.hostedresource.com;dbname=MyHead', 'MyHead', 'MenuHead@1234'); $objDb->exec('SET CHARACTER SET utf8'); $sql = "SELECT * FROM `tblRestaurants` WHERE `RestStatus` = 'YES' ORDER BY 'RestName'"; $statement = $objDb->query($sql); $list = $statement->fetchAll(PDO::FETCH_ASSOC); } catch(PDOException $e) { echo 'There was a problem'; }<p>?> <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8" /> <title>Dependable dropdown menu</title> <meta name="description" content="Dependable dropdown menu" /> <meta name="keywords" content="Dependable dropdown menu" /> <link href="/BigStuff/css/core.css" rel="stylesheet" type="text/css" /> <!--[if lt IE 9]> <script src="
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.