klar... gibt den einfach verschiedene Namen und überprüf, welcher Name am Script ankommt.
Gruss
Jan
Hey,
kann ich zwei Submit-Buttons für ein Formular machen??
Ich möchte je nachdem welcher Button gedrückt wird eine PHP-Script starten möchte aber nicht zweimal das gleiche Formular bauen!
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
klar... gibt den einfach verschiedene Namen und überprüf, welcher Name am Script ankommt.
Gruss
Jan
Äh ,entweder ich steh am Schlauch oder ich hab mich falsch ausgedrückt.
Ich hab ein Formular und zwei PHP-Scripts! Je nachdem welcher Button in dem Formular gedrückt wird soll eines der beiden Scripts angesprochen werden. Ich hab da irgendwie ein Problem mit dem "action"-Attribut im <form>-Tag. Oder seh ich den Wald vor lauter Bäumen nicht??
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
So dann nur mit Einsatz von JavaScript...
GrussCode:<input type="submit" onclick="this.form.action='script1.php'" value="ab zu script1" /> <input type="submit" onclick="this.form.action='script2.php'" value="ab zu script2" />
Jan
Super, danke für die Hilfe Jan!
lg
Flow
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
Noch ein kleiner Nachtrag: Diese Aktionen werden nicht ausgeführt, wenn das Formular per Enter abgeschickt wird.
Gut zu wissen, danke!! Gibts dafür auch eine erklärung??
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
schätze mal das dann onsubmit vom formular ausgeführt wird anstatt onclick von dem button.
öhm... ist ansich doch logisch? Die Aktionen werden ausgeführt, sobald das Event "onclick" (<-- betätigen des Buttons) ausgeführt wird - das Absenden eines Formulars kann auch durch Enter in einem Eingabefeld erfolgen.
onsubmit wird genauso "gefeuert"...
hätte da eine idee: mach doch ein dropdown mit den aktionen die du den 2 submits zuordnen wolltest und nur 1 submit-button. damit umgehts du die probleme wenn jemand enter-drückt und erweiterbar ist es auch noch.
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)