Markus: submit( )

Beitrag lesen

hey,
leider hab ich zu diesem Thema heute schon mal was gepostet...
aber dieses javascript spielt mir immer wieder einen Streich!
ich habe ein Formular und eine select-box. falls ich einen eintrag auswähle, soll das formular mittels "submit()" abgeschickt werden, was aber leider nicht geschieht.
ich poste im folgenden mein formular, welches in php eingebettet ist... es ist zwar etwas lang, aber vielleicht kann mir jemand helfen und sagen, warum mir ein javascript-fehler angezeigt wird !
vielleicht noch zur info: in meiner *.php befindet sich ein zweites formular, welches allerdings einen anderen namen trägt und somit auch nix zur sache tun müßte. ich wollte es nur erwähnt haben.

hier also meine source:
--------------------------------
echo "<form name='mainrep' action='" . $PHPSELF . "' method='get'>";
echo "<table class=bg0border align=center>
    <tr align='left'>
      <th>Location</th>

<th>Project</th>

<th>Month</th>
      <th>Year</th>
      <th>processed by</th>
      <th>Options</th>
   <th></th>
   <th></th>
    </tr>
    <tr>"; #1.Zeile
 // Standort-Auswahl
  $ssql = "select loc_name, location_id from location";
  $sel_loc = "";
  if ($sel_loc!="") { $ssql .= " where location_id ='$sel_loc' order by location_id"; }
  else              { $ssql .= " order by location_id"; };
  echo "<td>"; #1.Spalte
  #create_select("location", $conn, $ssql, $location);

echo "<select NAME='location' SIZE='$size' onchange='document.mainrep.submit()'>\n";
  #echo "<select NAME='location' SIZE='$size' >\n";
 $result = pg_exec ($conn, $ssql);
 $num = pg_numrows($result);
 for ($i=0; $i < $num; $i++) {
  $r = pg_fetch_row($result, $i);
  if ($i==0) { if ($location=="")  { $location=$r[1]; } }
  if ($r[1]==$location) {
    echo "<option selected value='$r[1]'>$r[0]</option>\n";
  }
 else {
    echo "<option value='$r[1]'>$r[0]</option>\n";
  }
 }
echo "</select></td>\n";

#Projekt-Auswahl:
  $ssql  = "select name,project_nr from projects where locationid = '" . $location . "' or locationid = NULL";
 echo "<td><select NAME='project'>\n";
 echo "<option selected value='all'>All Projects</option>\n";
 $result = pg_exec ($conn, $ssql);
 $num = pg_numrows($result);
 for ($i=0; $i < $num; $i++)
 {
  $r = pg_fetch_row($result, $i);
  if ($r[1]==$project)
  {
   echo "<option selected value='$r[1]'>$r[0]</option>\n";
  }
 else {
    echo "<option value='$r[1]'>$r[0]</option>\n";
  }
}
echo "</select></td>";

// Datum Monat
  $actual_month = date("n");
 echo "<td><select name='month' size=1>\n";
 if (isset($month)) {
  $actual_month = $month;
 }

#Monate anhaengen:
 for ($i=1; $i<=12; $i++) {
   if ($actual_month==$i) { $selected="selected"; } else { $selected=""; }
   echo sprintf("<option $selected value='%02d'>%d</option>\n", $i, $i);
 }
 if ($actual_month=="all") { $selected="selected"; } else { $selected=""; }
 echo "<option $selected value='all'>All</option>\n";
 echo "</select></td>\n";

// Datum Jahr
 $jahr = date("Y");
 echo "<td><select name='year' size=1>\n";
 for ($i=$jahr; $i>=$jahr-3; $i--) #zusätzlich letzten 3 Jahre anzeigen
 {
   if ($year==$i) { $selected="selected"; } else { $selected=""; }
   echo "<option $selected value='$i'>$i</option>\n";
 }
 echo "</select></td>\n";

// Benutzerauswahl
  $ssql = "select name, id from projectusers";
  $sel_usr = "";
  if ($sel_usr!="") { $ssql .= " where id ='$sel_usr' order by name"; }
  else              { $ssql .= " order by name"; };
  echo "<td>";
  create_select("user", $conn, $ssql, $user);
 echo "</td>";
 echo "<td>";

// Checkbox fuer Detailbeschreibung
 if ($cb_desc=="on") { $checkit = "checked='true'";}
 echo "<input type='checkbox' $checkit name='cb_desc' value='on'>Description";
 echo "</td><td>";

// Checkbox fuer Summe
    if ($cb_sum=="on") { $checkit_sum = "checked='true'";}
    echo "<input type='checkbox' $checkit_sum name='cb_sum' value='on'>Sum";
    echo "</td><td>";

// Submit Button
 echo "<input type='submit' name='submit' value="List" size=15>";

echo "</td></tr>\n";
    echo "</table>";
    echo "</form>";
---------------------------------

mfG,
    Markus.