If you have a form with x input and two or more buttons, how do you control which button has preceding when the user hits the keyboard key "enter"?
Currently it seems to be determined in a hierarchical manner.
E.g.
[HTML]
<form>
<input />
<input />
<button name="1" value="a" />
<button name="1" value="b" />
<button name="1" value="c" />
</form>
[/HTML]
When the user hits enter, button nr 1 will be activated, and value "a" will automatically be chosen as the default value (which is sent to PHP). How do you control this event so that button value "b" or "c" is activated instead?
(comp. to a situation as '<input type="hidden" name="1" value="a"/><input type="text" name="1" value="b"/>' where b would be the default)
I know you can handle this problem with javascript but I want to know if this can be handled with PHP.
How did the "designers of the HTML form functionality" perceive the use of several buttons?
Currently it seems to be determined in a hierarchical manner.
E.g.
[HTML]
<form>
<input />
<input />
<button name="1" value="a" />
<button name="1" value="b" />
<button name="1" value="c" />
</form>
[/HTML]
When the user hits enter, button nr 1 will be activated, and value "a" will automatically be chosen as the default value (which is sent to PHP). How do you control this event so that button value "b" or "c" is activated instead?
(comp. to a situation as '<input type="hidden" name="1" value="a"/><input type="text" name="1" value="b"/>' where b would be the default)
I know you can handle this problem with javascript but I want to know if this can be handled with PHP.
How did the "designers of the HTML form functionality" perceive the use of several buttons?
Comment