Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1286 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

the ENTER key and <buttons>

Thread title: the ENTER key and <buttons>
Closed Thread    
    Thread tools Search this thread Display Modes  
10-11-2007, 07:41 AM
#1
insub2 is offline insub2
Status: Member
Join date: Jun 2007
Location:
Expertise:
Software:
 
Posts: 136
iTrader: 1 / 100%
 

insub2 is on a distinguished road

Send a message via AIM to insub2

  Old  the ENTER key and <buttons>

Just wondering if someone could confirm this:

it seems that (in FF and Opera at least) when filling out a form pressing enter will go to the button that comes first in the HTML. (...i'm working on a survey that has a "back" button that was before the "continue" button.)


also, do you guys/gals think it's a good idea or bad idea to disable the enter key (by using javascript like this)?

10-11-2007, 11:08 AM
#2
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

It's a bad idea to work against common browser traits like this, without good reason. I fill out most forms and submit by pressing the Enter key.

Correct me if this is wrong but I think that pressing enter doesn't go to the first button and magically auto-clicks it, but rather it just submits the form. In other words, an 'onclick' event wouldn't fire for any of the buttons. That's something I've not tested it though so it's merely guess work.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed