• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

submit button

schismatic

Neues Mitglied
Heyda,

ich möchte mir ein Menü bauen welches über Buttons gesteuert wird, nur klappt das irgendwie nicht so ganz:

HTML:
  <form action="index.php?content=result" method="post">
    <input type="hidden" name="typ" value="one">
    <input type="submit" value="Eins">

  <form action="index.php?content=result" method="post">
    <input type="hidden" name="typ" value="two">
    <input type="submit" value="Zwei">
Egal welchen der beiden Knöpfe drücke, bei der Auswertung von $_POST['typ'] kommt immer "two" als Ergebnis :X

Irgendwie bin ich blind :|
 
naja ich wuerde zuerstmal sagen das da 2 </form> fehlen.

desweiteren wuerde ich den submit buttons auch einen namen geben damit du sie ansprechen kannst.

Code:
 [COLOR=#0000BB]<form action=[COLOR=#0000FF]"index.php?content=result"[/COLOR] method=[COLOR=#0000FF]"post"[/COLOR]>[/COLOR]
    [COLOR=#0000BB]<input type=[COLOR=#0000FF]"hidden"[/COLOR] name=[COLOR=#0000FF]"typ"[/COLOR] value=[COLOR=#0000FF]"one"[/COLOR]>[/COLOR]
    [COLOR=#0000BB]<input type=[COLOR=#0000FF]"submit"[/COLOR] name="one"value=[COLOR=#0000FF]"Eins"[/COLOR]>[/COLOR]
</form>

  [COLOR=#0000BB]<form action=[COLOR=#0000FF]"index.php?content=result"[/COLOR] method=[COLOR=#0000FF]"post"[/COLOR]>[/COLOR]
    [COLOR=#0000BB]<input type=[COLOR=#0000FF]"hidden"[/COLOR] name=[COLOR=#0000FF]"typ"[/COLOR] value=[COLOR=#0000FF]"two"[/COLOR]>[/COLOR]
    [COLOR=#0000BB]<input type=[COLOR=#0000FF]"submit"[/COLOR] name="two" value=[COLOR=#0000FF]"Zwei"[/COLOR]>[/COLOR] 
</form>
 
Zurück
Oben