Results 1 to 3 of 3

Thread: Dynamic Ajax Load Help...Jscheur??

  1. #1
    Join Date
    Dec 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Load Help...Jscheur??

    1) Script Title: Dynamic Ajax Load

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem:
    I am working on a site and am using ajaxpage for multiple dropdown menus. The first drop down menu works fine in opening the next menu using ajax, but then the second menu will not load anything. I believe that I need to manually trigger the ajaxload script again since the new content has been loaded into the page after the script initially loaded. I tries reloading the script using the loadvars object. Here is the url to my page:
    www dot coreymichaelstudio dot com/janmar/cat-recessed-lu.php
    The ajax is being used on the "select model" menu.

    Code:
    <!--Start Manufacturer-->
                        <label for="manufacturer">Select Manufacturer</label>
                        <select id="manufacturer" class="dropdown" name="manufacturer" title="manufacturer">
                            <?php while ($mfg = mysql_fetch_assoc($mfgresult)){
    							$manufacturer = $mfg['manufacturer'];
    							echo '<option onclick="ajaxpage("modules/lu/model.php?cmh=$cmh&mfg=$mfg", "model-selector");" value="'.$manufacturer.'"><p>'.$manufacturer.'</p></option>';	
    							}
    							mysql_free_result($mfgresult);
    						?>
                        </select> 
                        <!--End Manufacturer-->

    Thanks in advance for any help!!!
    Last edited by santamonica10; 03-26-2008 at 07:25 AM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Switch:
    Code:
    <option onclick="ajaxpage("modules/lu/model.php?cmh=$cmh&mfg=$mfg", "model-selector");"
    To:
    Code:
    <option onclick="ajaxpage(\'modules/lu/model.php?cmh=$cmh&mfg=$mfg\', \'model-selector\');"
    This should work.
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Actually, this would be a better solution:

    Code:
    <!--Start Manufacturer-->
                        <label for="manufacturer">Select Manufacturer</label>
    <select id="manufacturer" class="dropdown" name="manufacturer" title="manufacturer">
    <?php 
     while ($mfg = mysql_fetch_assoc($mfgresult)) {
        $manufacturer = $mfg['manufacturer'];
    ?>
      <option onclick="ajaxpage('modules/lu/model.php?cmh=<?php echo $cmh; ?>&mfg=<?php echo $mfg; ?>', 'model-selector');" value="<?php echo $manufacturer; ?>"><p><?php echo $manufacturer; ?></p></option>
     }
    mysql_free_result($mfgresult);
    ?>
    </select> 
    <!--End Manufacturer-->
    Or even this would suffice:

    Code:
    <!--Start Manufacturer-->
                        <label for="manufacturer">Select Manufacturer</label>
                        <select id="manufacturer" class="dropdown" name="manufacturer" title="manufacturer">
                            <?php while ($mfg = mysql_fetch_assoc($mfgresult)){
    							$manufacturer = $mfg['manufacturer'];
    							echo '<option onclick="ajaxpage(\'modules/lu/model.php?cmh='.$cmh.'&mfg='.$mfg.'\', \'model-selector\');" value="'.$manufacturer.'"><p>'.$manufacturer.'</p></option>';	
    							}
    							mysql_free_result($mfgresult);
    						?>
                        </select> 
                        <!--End Manufacturer-->
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •