Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31887

Re: Techniques to prevent accidental press of the Enter key that submits a FORM

From KnightStalker <7oo7le7roupie@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Techniques to prevent accidental press of the Enter key that submits a FORM
Date 2016-12-16 12:24 -0500
Organization A noiseless patient Spider
Message-ID <o317ue$j8a$1@knightstalker.eternal-september.org> (permalink)
References <28167554-422a-4b89-81e9-071e7475e821@googlegroups.com> <enter-20161214120502@ram.dialup.fu-berlin.de> <2269631.Lt9SDvczpP@PointedEars.de> <o2rl53$kk2$1@knightstalker.eternal-september.org> <4ea3125b-3ced-44be-b21d-5ea9b60b5213@googlegroups.com>

Show all headers | View raw


On 12/15/2016 5:21 PM, justaguy wrote:
> On Wednesday, December 14, 2016 at 9:33:32 AM UTC-5, KnightStalker wrote:
>> On 12/14/2016 7:04 AM, Thomas 'PointedEars' Lahn wrote:

>>> JFTR: The form is only submitted on pressing the Enter/Return key if
>>> there is an *enabled* *submit* button and the element that has the
>>> focus is an “input” element with a text type (“text”, “email” etc.)

>> Multiple submit buttons?

[snip]

>>   <form id=f0 action="/form.html" method=get>
>>     <div>
>>       <input type=text name=n>
>>     </div>
>>     <div>
>>       <input type=checkbox id=inpu0 required>
>>       <label for=inpu0>check to enable submit</label>
>>       <input disabled hidden type=submit>
>>       <input type=submit value=Submit>
>>     </div>
>>   </form>

[snip]

> While I welcome inputs including yours, the method of "GET" is 
> definitely a NO NO for a FORM that would engage a user with
> substantial amount of data input.

> With the GET method, maximum URL length is 2048 characters.

[url] https://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.2 [/url]

  ¦  If the processing of a form is idempotent (i.e. it has no lasting
  ¦  observable effect on the state of the world), then the form method
  ¦  should be `GET'. Many database searches have no visible
  ¦  side-effects and make ideal applications of query forms.

[url] https://www.w3.org/TR/html401/interact/forms.html#h-17.13.1 [/url]

  ¦  The "get" method should be used when the form is idempotent (i.e.,
  ¦  causes no side-effects). Many database searches have no visible
  ¦  side-effects and make ideal applications for the "get" method.

In the example posted, the form is idempotent.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Techniques to prevent accidental press of the Enter key that submits a FORM justaguy <lichunshen84@gmail.com> - 2016-12-13 18:48 -0800
  Re: Techniques to prevent accidental press of the Enter key that submits a FORM "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-14 10:14 +0100
    Re: Techniques to prevent accidental press of the Enter key that submits a FORM justaguy <lichunshen84@gmail.com> - 2016-12-14 05:42 -0800
  Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 13:04 +0100
    Re: Techniques to prevent accidental press of the Enter key that submits a FORM justaguy <lichunshen84@gmail.com> - 2016-12-14 05:45 -0800
    Re: Techniques to prevent accidental press of the Enter key that submits a FORM KnightStalker <7oo7le7roupie@gmail.com> - 2016-12-14 09:33 -0500
      Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 16:19 +0100
        Re: Techniques to prevent accidental press of the Enter key that submits a FORM Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-12-14 16:42 +0100
          Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 18:00 +0100
        Re: Techniques to prevent accidental press of the Enter key that submits a FORM KnightStalker <7oo7le7roupie@gmail.com> - 2016-12-14 11:27 -0500
          Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 18:00 +0100
            Re: Techniques to prevent accidental press of the Enter key that submits a FORM KnightStalker <7oo7le7roupie@gmail.com> - 2016-12-16 11:03 -0500
              Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-16 17:54 +0100
                Re: Techniques to prevent accidental press of the Enter key that submits a FORM KnightStalker <7oo7le7roupie@gmail.com> - 2017-01-06 15:08 -0500
      Re: Techniques to prevent accidental press of the Enter key that submits a FORM justaguy <lichunshen84@gmail.com> - 2016-12-15 14:21 -0800
        Re: Techniques to prevent accidental press of the Enter key that submits a FORM KnightStalker <7oo7le7roupie@gmail.com> - 2016-12-16 12:24 -0500
  Re: Techniques to prevent accidental press of the Enter key that submits a FORM John Harris <niam@jghnorth.org.uk.invalid> - 2016-12-14 15:07 +0000
    Re: Techniques to prevent accidental press of the Enter key that submits a FORM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 23:31 +0100
    Re: Techniques to prevent accidental press of the Enter key that submits a FORM justaguy <lichunshen84@gmail.com> - 2016-12-15 14:15 -0800
  Re: Techniques to prevent accidental press of the Enter key that submits a FORM Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-12-17 21:02 +0000

csiph-web