[phplib] templates and menus - HELP!! From: paula (paula <email protected>)
Date: 03/27/01

ok, this is driving me crazy, so any idea is welcome:

I'm using PHPLIB templates. There are multiple tables nested, inside one cell (<td></td>) there should be a drop down menu, each option is an array element. I've made a simple function to create drop down menus:

function MenuMaker($form_name,$select_name,$act,$my_arr) {

  echo "\n";
  echo '<form name="'.$form_name.'" method="post" action="'.$act.'">'."\n";
  echo '<select name='.$select_name.'>'."\n";
  while (list($key,$value)=each($my_arr)) {
    echo '<option value='.ereg_replace(" ","_",$value).'>'.$value.'</option>'."\n";
  }
  echo '</select>'."\n";
  echo '<input type="button" value="GO" style="BACKGROUND: #6699FF; FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; FONT-WEIGHT: bold; padding:1; border:thin solid black; width=30">'."\n";
  echo '</form>'."\n";

}

inside this cell I put: <td>{division_list}</td>

Then, on my script I use $division_list => (MenuMaker("division","division_list","scr.php",$my_arr))

I also tried defining a variable: $division_list = (MenuMaker("division","division_list","scr.php",$my_arr) and the, on set_var : "division_list" => $division_list,

The thing is that the menu appears at the begining of the html page, not in the place where is suposed to be. The cell is empty and the menu goes first, just after the headers.

                                 W H Y !? W H Y !? W H Y !? W H Y !?

I've tried EVERYTHING, and the menu still appears at the begining of the html page.

Help me please! or the next time I'll write from a mental health institution.

thanks guys-

/paula