Dynamic Jump Menu with autocomplete not passing info in URL

I am having difficulty  with a dynamic jump menu i am using in DWCS3. The problem is the page won't process the new page with the id I am trying to pass through. I am using an autocomplete behavior and a script that shortens the display text, but I can't seem to get the actually jumping part to work in the menu. I removed the action from the form just because i had no idea where to process it. I feel like I need to edit the onchange() function, but not sure to what. Basically, I have a DB dynamically filling the menu with all the listings I have, and I want to be able to start typing in a search, have it autocomplete the text, and jump to the listings page with the category ("cat") id passed through the url.  The script i have so far is :


<form id="formsearch" name="formsearch" method="post" action="#">
     
      <label for="jumpMenu">search for listing</label>
   
     <select name="jumpMenu" id="jumpMenu" class="autoconvert" onchange="MM_jumpMenu('parent',this,0)" style="width:110px;">
   
 <?php
do {  
?>

       <option value="<?php echo $row_rsListingAll['listing_id'] ?>">
        
          <a href="listings.php?cat=<?php echo $row_rsListingAll['listing_category_id']; ?>">  

<?php       $short_search = $row_rsListingAll['listing_title'];
                              
                              if(strlen($short_search) > 15)
                              {
                              $totalChars = 15;
                              $short_search = substr($short_search,0,$totalChars)."...";
                              }
            
            echo $short_search ?>

       </a>

       </option>
       
        <?php
} while ($row_rsListingAll = mysql_fetch_assoc($rsListingAll));
  $rows = mysql_num_rows($rsListingAll);
  if($rows > 0) {
      mysql_data_seek($rsListingAll, 0);
        $row_rsListingAll = mysql_fetch_assoc($rsListingAll);
  }
?>
      </select>
     
       
      </form>
digiblisAsked:
Who is Participating?
 
Jason C. LevineConnect With a Mentor No oneCommented:
Hi digiblis,

I'm a little confused by your option code.  It looks like your doing too much there and the wrong value is being passed to the mm_jumpMenu.

Try something like this instead:

<option value="listings.php?cat=<?php echo $row_rsListingAll['listing_category_id'] ?>">
<?php       $short_search = $row_rsListingAll['listing_title'];
                             
                              if(strlen($short_search) > 15)
                              {
                              $totalChars = 15;
                              $short_search = substr($short_search,0,$totalChars)."...";
                              }
           
            echo $short_search ?>
</option>

The main fix is to pass both the page and query string through mm_jumpMenu.  However, if you have been futzing with the DW generated code, it may to remove it and start over.  It's twitchy that way.

J
0
 
digiblisAuthor Commented:
thanks very much. simple and effective.
0
 
Jason C. LevineNo oneCommented:
You're welcome!
0
 
Jason C. LevineNo oneCommented:
Just out of curiosity, what would have made this an A answer?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.