Submitting a Form that has Control Events

Discussion in 'Javascript' started by Gene Wirchenko, Feb 23, 2012.

  1. Dear JavaScripters:

    I am putting what I thought would be the final touches on the
    first cut for a form handler.

    I have validation on controls and on the form as a whole. The
    control-level validations work just fine, and focus does not move off
    the control. This is what I want.

    I now need to have the submit sequence done. Roughly, it is:
    Run validation on each data control stopping if an error and
    setting the focus to the erroneous control.
    Run each form-level validation stopping if an error and
    setting the focus to the first of the erroneous controls.
    The actual submit (not implemented yet).

    I click Submit and...

    Sometimes, especially if the current control is one that has a
    validation rule, the function I have written for submitting does not
    get run. (If there is a control validation, the control validation
    will run.) Clicking again on the submit button will usually result in
    the submit code then running.

    Note that if the form-level validation runs, it does run
    correctly. My problem is sometimes, it does not run at all. (An
    alert() at the beginning of the function does not execute.)

    This is obviously not what I want. I have done some looking, but
    I have not found anything covering this. Part of the problem that I
    am having is that I am not sure how I should be coding this. The
    simplistic form submit code that I have found is not enough.

    Could someone please post some skelton code or pointer to the
    same for submitting when some processing has to be done first,
    especially code that understands control events can occur?

    Sincerely,

    Gene Wirchenko
     
    Gene Wirchenko, Feb 23, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel Hon
    Replies:
    4
    Views:
    7,793
    Samuel Hon
    Mar 6, 2004
  2. Dave Smithz
    Replies:
    3
    Views:
    34,723
    mokker
    Oct 30, 2009
  3. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    388
    Chris
    Aug 30, 2005
  4. Marco Alting
    Replies:
    7
    Views:
    537
    Thomas 'PointedEars' Lahn
    Oct 30, 2003
  5. Kai Grossjohann
    Replies:
    4
    Views:
    288
Loading...

Share This Page