Click here to get back home

Order of buttons?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Order of buttons? wolfing1 10-06-2005
---> Re: Order of buttons? Benjamin Nieman...10-06-2005
Posted by wolfing1 on October 6, 2005, 9:37 am
Please log in for more thread options


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)


Posted by Michael Winter on October 6, 2005, 5:20 pm
Please log in for more thread options


On 06/10/2005 17:37, wolfing1@gmail.com wrote:

[snip]

> 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.

> 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.

Posted by Benjamin Niemann on October 6, 2005, 11:14 pm
Please log in for more thread options


wolfing1@gmail.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.

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

Posted by wolfing1 on October 7, 2005, 7:52 am
Please log in for more thread options



Benjamin Niemann wrote:
> wolfing1@gmail.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


Similar ThreadsPosted
css parsing order May 20, 2006, 8:11 pm
Z order for frames January 14, 2008, 8:55 pm
div presentation order April 28, 2008, 7:28 pm
DIV Tag Not on Top Z-Index Order Problem? March 25, 2005, 3:03 pm
WYSIWYG order forms? November 24, 2007, 2:20 am
Floating DIV positioning. How much does the order matter? December 29, 2005, 7:25 am
Order of next, home, prev links in page August 21, 2005, 3:19 pm
"force" user to use site in defined order? April 1, 2008, 1:54 am
Help With RSS Red Feed Buttons October 21, 2006, 3:56 pm
Wtd: HTML editor to swap the order of columns in tables August 27, 2006, 7:05 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap