The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Naruki: Submitting a form by mikosullivan 2006-11-19 12:55:59
This is a response to Naruki's question yesterday.

What makes the web page submit when you press Enter? and how does the form know which button you expected to be pressed?

Submitting the form when the user presses enter is not behavior that is defined by the HTML standards, but it's not specifically prohibited either. It's just a design choice the browser makers made. The issue of which submit button is "pressed" when the user hits enter is undefined. MSIE clicks the first submit button.

These are all design issues you should take into account when designing your form. For example, when UF comment system was redesigned recently, they put the submit button first, then the preview button. Unfortunately when users hit enter their comments were submitted whether they were ready or not, resulting in a lot of inanane comments (um, well, more than usual anyway :-) ). The UFies that be rearranged the form so that the "Submit" button goes second, and that furthermore the comment isn't submitted unless that button is sent.

JavaScript can be used to catch the button click and form submit events and give the user a chance to cancel those events.

Here are some links to further details about submit buttons and JavaScript:

[ Reply ]
  Response to your question yesterday by IByte2001-11-12 07:16:22
  Thanks a bunch. by Naruki2001-11-12 09:23:31
    Welcome back! by kickstart2001-11-12 10:28:37
      kickstart! shh! quit staring! by grovella2001-11-12 10:48:54
        Then I'm to be flogged, eh? by Naruki2001-11-12 11:23:47
        I don't know about rare. by nin_man2001-11-12 20:31:52

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)