Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Mike Duffy Newsgroups: comp.lang.javascript Subject: Re: Submitting a Form that has Control Events Date: Fri, 24 Feb 2012 02:22:29 +0000 (UTC) Organization: Your Company Lines: 41 Message-ID: References: <9ghbk7hh8t3jbka7kmepejfnqng4vbjqgo@4ax.com> <621dk7dl90v2t97pca84jdquncbu3sk07u@4ax.com> <5undk71pkqh9agf6ifj0ch2gad5d60hq2i@4ax.com> NNTP-Posting-Host: 8GXtu24jXTHJm9OLlhLTEQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: Xnews/5.04.25 X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:12119 Gene Wirchenko 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