HighDots Forums  

Order of buttons?

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Order of buttons? in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
wolfing1@gmail.com
 
Posts: n/a

Default Order of buttons? - 10-06-2005 , 12:37 PM






My boss wants me to do some forms without any type of scripts, just
pure HTML/ASP.
I have this table with 3 rows, each row has an <input=text> and ends
with an <input type=submit> buttons, and the last row has what I want
to be the default <input type=submit>. Problem is, when I press
<enter> in any of the text fields, it acts as if the first row's submit
button was pressed.
How can I affect this behaviour if I want to keep the appeareance of
the page? (without scripts), it should also work in most browsers (not
only IE)


Reply With Quote
  #2  
Old   
Michael Winter
 
Posts: n/a

Default Re: Order of buttons? - 10-06-2005 , 01:20 PM






On 06/10/2005 17:37, wolfing1 (AT) gmail (DOT) com wrote:

[snip]

Quote:
I have this table with 3 rows, each row has an <input=text> and ends
with an <input type=submit> buttons, and the last row has what I want
to be the default <input type=submit>. Problem is, when I press
enter> in any of the text fields, it acts as if the first row's submit
button was pressed.
This is the problem with using multiple submit buttons.

Quote:
How can I affect this behaviour if I want to keep the appeareance of
the page? [...]
IE will choose the first submit button as the default. Other buttons can
be activated with the Enter key, but they must be given focus first
which won't happen if the user is interacting with another control (and
isn't behaviour that could be reliably changed with a script, anyway).

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.


Reply With Quote
  #3  
Old   
Benjamin Niemann
 
Posts: n/a

Default Re: Order of buttons? - 10-06-2005 , 05:14 PM



wolfing1 (AT) gmail (DOT) com wrote:

Quote:
My boss wants me to do some forms without any type of scripts, just
pure HTML/ASP.
I have this table with 3 rows, each row has an <input=text> and ends
with an <input type=submit> buttons, and the last row has what I want
to be the default <input type=submit>. Problem is, when I press
enter> in any of the text fields, it acts as if the first row's submit
button was pressed.
How can I affect this behaviour if I want to keep the appeareance of
the page? (without scripts), it should also work in most browsers (not
only IE)
Untested: you may try to put the last row with your default button into the
TFOOT element of the table:

<table>
<tfoot>
<tr>...default submit button...</tr>
</tfoot>
<tbody>
...other rows...
</tbody>
</table>

The TFOOT must preceed the TBODY, but is displayed below TBODY - so it may
be exactly what you want (if browsers determine the 'first' submit button
based on the source order).
And this should IMHO even be a semantically correct usage of the TFOOT
element.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/


Reply With Quote
  #4  
Old   
wolfing1@gmail.com
 
Posts: n/a

Default Re: Order of buttons? - 10-07-2005 , 10:52 AM




Benjamin Niemann wrote:
Quote:
wolfing1 (AT) gmail (DOT) com wrote:

My boss wants me to do some forms without any type of scripts, just
pure HTML/ASP.
I have this table with 3 rows, each row has an <input=text> and ends
with an <input type=submit> buttons, and the last row has what I want
to be the default <input type=submit>. Problem is, when I press
enter> in any of the text fields, it acts as if the first row's submit
button was pressed.
How can I affect this behaviour if I want to keep the appeareance of
the page? (without scripts), it should also work in most browsers (not
only IE)

Untested: you may try to put the last row with your default button into the
TFOOT element of the table:

table
tfoot
tr>...default submit button...</tr
/tfoot
tbody
...other rows...
/tbody
/table

The TFOOT must preceed the TBODY, but is displayed below TBODY - so it may
be exactly what you want (if browsers determine the 'first' submit button
based on the source order).
And this should IMHO even be a semantically correct usage of the TFOOT
element.

OMG, this worked thanks a lot!
The more I learn, the more things I realize I don't know



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.