mam na stronie kilka submitów
idea:
zapisz: zapisuje dane i zostaje na stronie
poprzednia strona - zapisuje formularz i przechodzi do poprzedniej strony
następna strona - zapisuje formularz i przechodzi do poprzedniej strony...

korzystam z kodu
Formularz:
  1. <form action="#" method="post" class="form" name="form1" id="f1">

Przyciski
  1. <input type="submit" onclick="document.getElementById('f1').action='#';" style="float:right" value="zapisz" />
  2. <input type="submit" onclick="document.getElementById('f1').action='?s=back';" style="float:left" value="poprzednia" />
  3. <input type="submit" onclick="document.getElementById('f1').action='?s=next';" style="float:right" value="nastepna" />

po wysłaniu formualrza sprawdzam wartość $_GET[s] i przekierowuje na odpowiednią stronę

Ogólnie działa... poza jednym przypadkiem
też mam ten kod i 2 formularze na stronie
id="f1"
i id="inny"
  1. <form action="#" method="post" class="form" name="form1" id="f1">
  2. tresc
  3. <input type="submit" onclick="document.getElementById('f1').action='#';" style="float:right" value="zapisz" />
  4. </form>
  5. <form action="#" method="post" class="form" name="form1" id="inny">
  6. tresc
  7. </form>
  8. <input type="submit" onclick="document.getElementById('f1').action='?s=back';document.getElementById('f1').submit()" style="float:left" value="poprzednia" />
  9. <input type="submit" onclick="document.getElementById('f1').action='?s=next';document.getElementById('f1').submit()" style="float:right" value="nastepna" />


Już rozwiązałam musiałam dopisać:
  1. document.getElementById('f1').submit()

Działa :-D