Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 13.12.06 10:58 
Hallo
Ich habe eine Frage zu HTML und zwar:

Gibt es einen Befehl mit dem ich bei einem Formular mit 2 Submit Buttons einen der beiden als Default bestimmen kann, sodass dieser auf die Enter-Taste reagiert ?

Danke.
Matze

_________________
In the beginning was the word.
And the word was content-type: text/plain.
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Mi 13.12.06 11:21 
Hi,
am besten du gibst nur deinenm Default-Button den Typ "submit", allen anderen den typ "button".

sonst könnte man es nur noch mit javascript lösen, aber das setzt halt immer aktiviertes javascript vorraus.
shil
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 143

Windows Xp
C#
BeitragVerfasst: Mi 13.12.06 13:12 
also ambesten ist :
ausblenden Quelltext
1:
2:
3:
4:
5:
<form action="linkzudernächstenseite" method="post">
  <p>Test:<input name="test" type="text"></p>
  <input type="submit">
  <input type="reset">
</form>


wenn du enter drückst ist submit der "primäre" button
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 13.12.06 13:24 
ja das ist klar. Ich habe aber 2 Submit Buttons, weil beide das Formular absenden, aber jeweils zu einem anderen zweck.
PS: Die beiden Buttons sind "vor" und "zurück"

_________________
In the beginning was the word.
And the word was content-type: text/plain.
shil
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 143

Windows Xp
C#
BeitragVerfasst: Mi 13.12.06 14:05 
zur not selfhtml.org is ne ganz nette seit über html
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 13.12.06 20:10 
da hab ich auch schon geschaut und nix gefunden :-(

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 13.12.06 20:26 
Das geht IMHO nicht ohne Javascript. Wie man zwischen den gedrückten Buttons per PHP unterscheidet, weißt du, oder?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 13.12.06 21:30 
wie das in PHP geht weiß ich. Dann werde ich das wohl via JS machen müssen.

Ich finde das nur komisch. Wenn ich in einem Formular 2 Buttons und ein Eingabefeld habe und dann in dem Eingabefeld auf ENTER drücke wird gar nicht gemacht sondern nur der Inhalt verschwindet.

Ich sehe mich mal nach ner JavaScript Lösung um.

Danke !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
wolke
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 240



BeitragVerfasst: Mi 13.12.06 22:47 
bitteschön: www.faqs.org/docs/ht...dex_famsupp_157.html

leider scheint es wirklich keine gute lösung ohne javascript zu geben.
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 14.12.06 14:08 
Danke dafür. Das hat mir sehr geholfen !

_________________
In the beginning was the word.
And the word was content-type: text/plain.