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


Groups > comp.lang.javascript > #12109

Re: Submitting a Form that has Control Events

From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.lang.javascript
Subject Re: Submitting a Form that has Control Events
Date 2012-02-23 10:36 -0800
Organization A noiseless patient Spider
Message-ID <621dk7dl90v2t97pca84jdquncbu3sk07u@4ax.com> (permalink)
References <9ghbk7hh8t3jbka7kmepejfnqng4vbjqgo@4ax.com> <XnsA002502F4CF5Finvalidcom@94.75.214.39>

Show all headers | View raw


On Thu, 23 Feb 2012 12:52:44 +0000 (UTC), Mike Duffy
<Use_guestbook_page@website.in.sig> wrote:

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

>>      I click Submit and...
>
>You should either give us the url of the page or its source if it is not on 
>the Internet. Better yet, a skeleton of just a few lines that does not work 
>as you think it should.

     It is over a thousand lines, and I do not know where the error
is.  I was hoping to get a bit of guidance as to what to look for.

     I suspect some interaction of events, but that is about all I
have.

     I would like a non-trivial skeleton of a form submit, something
that accounts for events.  I can find trivial examples easily enough.
I need something more sophisticated.  I can adapt that to fit my
needs.

     I am using IE9 under Windows 7.

>> Sometimes, especially if the current control is one that has a
>> validation rule, the function I have written for submitting does not
>> get run. 
>
>When you say "current", do you mean the form element which currently has 
>focus? Does each form element have an "onBlur" validation function applied 

     Yes.

>to it, or just onKeypress/onClick? Did you remember to return "true" in all 

     onblur.  I do not use onkeypress and onclick.

>of those functions when the form values are okay?

     Yes.  Much of the code is generated, so it is make it work once
and reuse.

     As well as validation, the control-level validation also does
data cleanup (e.g. capitalisation).  The controls that also have a
validation expression are the troublesome ones IT SEEMS.

>I see that you are sumitting with the button, but some people will press 
><Enter> to submit a form regardless of the instructions on the screen. So 

     For now, I am using the button.  Why does the event not fire
reliably?

>you should have "onKeypress" handlers for your checkboxes and "onClick" 
>handlers for your text fields, etc.

     Oh, my.  Something else to worry about.  It seems it never ends.

     I would like to deal with the current problem first.

Sincerely,

Gene Wirchenko

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