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


Groups > comp.lang.javascript > #12119

Re: Submitting a Form that has Control Events

From Mike Duffy <Use_guestbook_page@website.in.sig>
Newsgroups comp.lang.javascript
Subject Re: Submitting a Form that has Control Events
Date 2012-02-24 02:22 +0000
Organization Your Company
Message-ID <XnsA002D9783FE3Binvalidcom@94.75.214.39> (permalink)
References <9ghbk7hh8t3jbka7kmepejfnqng4vbjqgo@4ax.com> <XnsA002502F4CF5Finvalidcom@94.75.214.39> <621dk7dl90v2t97pca84jdquncbu3sk07u@4ax.com> <XnsA002BE1BCEAAEinvalidcom@94.75.214.39> <5undk71pkqh9agf6ifj0ch2gad5d60hq2i@4ax.com>

Show all headers | View raw


Gene Wirchenko <genew@ocis.net> wrote in
news:5undk71pkqh9agf6ifj0ch2gad5d60hq2i@4ax.com: 

>>
>>function armSendButton(arg)
> 
>      Where does this function get called, please?  In the onkeypress
> clause of each input control?

Yes. I define the function in the head (or body before the form that uses 
it). Then I designate it as the onKeypress event for *every* text input 
control in the entire form.

In my case, I simply wanted to disable form submission until the user has  
made a change in any form element. It may seem had to believe, but I was 
getting spam from robots visiting my "guestbook" page.

Apparently, they parse the HTML in order to find all text fields (and 
fill them with urls for porn & viagra) and then execute the submit 
action. So I leave the action empty on the page initially, and then I put 
the proper action into the form at the same time as I enable the button.

> 
> [snip]
> 
>> ... you should have onKeypress for all non-text fields
>                                     ^^^^^^^^^^^^
>      Like what?  Or did a gremlin insert "non-"?  What is a non-text
> field?

I'm probably guilty of using the wrong nomenclature. By this I mean all 
form elements which are not text fields. (Radio buttons, checkboxes, 
buttons & drop-down lists) Just to handle Enter / Tab / Escape.


> Sorry for all the questions,

Don't worry about it.

-- 
http://pages.videotron.ca/duffym/index.htm

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


Thread

Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-22 21:03 -0800
  Re: Submitting a Form that has Control Events Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-02-23 12:52 +0000
    Re: Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-23 10:36 -0800
      Re: Submitting a Form that has Control Events Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-02-23 23:41 +0000
        Re: Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-23 16:48 -0800
        Re: Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-23 17:00 -0800
          Re: Submitting a Form that has Control Events Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-02-24 02:22 +0000
            Re: Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-23 18:35 -0800
              Re: Submitting a Form that has Control Events Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-02-24 05:10 +0000
                Re: Submitting a Form that has Control Events Gene Wirchenko <genew@ocis.net> - 2012-02-24 09:43 -0800
          Re: Submitting a Form that has Control Events Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-02-24 02:22 +0000

csiph-web