Ok hope I clarify things here and any help is appreciated


function ShowPage($size) {

/* init next and previous link class. Set a default page size of 40 */

  if (empty($size)) { $size = "40"; }
  if (empty($pg_which)) { $pg_which=1; }
  $nav = new navigator;
  $nav->pg_size = $size;
  $nav->cp_size = $max_pages;
  $nav->cp_more = $max_chapters;
  $nav->href = "browse.php";
  $nav->more_param = "&cat=$cat";

  $nav->pg_which=$pg_which;
  $nav->rec_count=$num_rows;
  $nav->init(); 

 /* Generate a dropdown list menu */

$record = "<select name=menu1 onChange=\"MM_jumpMenu('self',this,0)\">\n";
  for($records = 10; $records <= 100; $records += 10) {
    if ($records == $size) { $sel = ' selected'; }
    $record .= "<option value=\"browse.php?cat=$cat&size=" . $records . "\"" . $sel . ">" . $records . " Results</option>\n";
  }
  $record .= "</select>\n";
  $pagination = $nav->print_all();

I've already set a default value of 40 results to be shown so I have to make the dropdown to select on 40, but the results in html source goes like this:


<select name=menu1 onChange="MM_jumpMenu('self',this,0)">
<option value="browse.php?cat=476&size=10">10 Results</option>
<option value="browse.php?cat=476&size=20">20 Results</option>
<option value="browse.php?cat=476&size=30">30 Results</option>
<option value="browse.php?cat=476&size=40" selected>40 Results</option>
<option value="browse.php?cat=476&size=50" selected>50 Results</option>
<option value="browse.php?cat=476&size=60" selected>60 Results</option>
<option value="browse.php?cat=476&size=70" selected>70 Results</option>
<option value="browse.php?cat=476&size=80" selected>80 Results</option>
<option value="browse.php?cat=476&size=90" selected>90 Results</option>
<option value="browse.php?cat=476&size=100" selected>100 Results</option>
</select>

Any ideas?

    i dont see anything really wrong, but rty changing

    // this:
    if ($records == $size) { $sel = ' selected'; }
    
    // to this:
    
    $sel=(($records==$size)?" selected":"");
    

    bc as far as i know, once it hits 40, the $sel = "selected" and its never un-defined, so as it loops through, $sel still = selected..

    hope thats clear 🙂

      no dice. Still the same. I'm going crazy...

        oh it works! I've misplaced your code!!! Oh my, thanks alot and a million! Broken!!!

          n/p, im always writing that code, so i know how annoying it can get 😃

            Write a Reply...