[thelist] submit button 'focus'

Tom Dell'Aringa pixelmech at yahoo.com
Wed Feb 12 11:09:01 CST 2003


I'm not sure if this is a newer browser feature or not, but you'll
notice (for sure in IE6) that when you have a form and you give focus
to a field in that form, that the submit button 'highlights' itself,
or is focused, for lack of a better term.

In IE6 PC, this shows as a blue border if the button is not styled.

We have a form with 2 submit buttons. Both buttons submit the same
form and perform the same action - except that clicking one of the
buttons returns you to the same page, the other one sends you
somewhere else (this is based on the name value of the submit button
and handled server side). In other words, the action is a jsp
servlet, and that servlet will send you to a destination based on
which submit button you press.

Okay - the issue I have is HOW to set (if possible) this 'submit
button focus' feature. I cannot find any documentation on it. It
seems that the first button in the HTML is the one that gets it.

Problem is, sometimes they want the SECOND button to get it. (Its
always something!)

I'd like to figure this out, otherwise they are going to force me to
make all buttons as type=button and use onClick for submits and
everything.

here is a test form for ya:

==================
<form name="test">
foo <input type="text">
<input type="submit" name="fun" value="submit">
<input type="submit" name="goo" value="submittoo">
</form>
==================

TIA

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



More information about the thelist mailing list