How to execute client-side code _after_ client-side validation?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bogdan

    How to execute client-side code _after_ client-side validation?

    Hi,

    I'd like to display (i.e. make visible) a label after a submit button is
    clicked but only if the client-side validation is successful. If I did not
    care about the validation then I'd simply modify style.display of the label
    in my onclick (OnClientClick) script. The problem is that my script will
    execute before the validation script.
    Is there a way to execute my custom script after the validation takes place?

    Thanks,
    Bogdan



  • bruce barker

    #2
    Re: How to execute client-side code _after_ client-side validation?

    use ClientSCriptMan ager.RegisterOn SubmitStatement

    -- bruce (sqlwork.com)

    Bogdan wrote:
    Hi,
    >
    I'd like to display (i.e. make visible) a label after a submit button is
    clicked but only if the client-side validation is successful. If I did not
    care about the validation then I'd simply modify style.display of the label
    in my onclick (OnClientClick) script. The problem is that my script will
    execute before the validation script.
    Is there a way to execute my custom script after the validation takes place?
    >
    Thanks,
    Bogdan
    >
    >
    >

    Comment

    • Bogdan

      #3
      Re: How to execute client-side code _after_ client-side validation?

      Bruce,

      Thanks for the reply. Your suggestion only partially worked for me. I have
      a RequiredFieldVa lidator and RegularExpressi onValidator attached to fields.
      If the former fails than my onsumbit script is not executed. Unfortunately,
      this is not the case for the regex validator - my onsubmit is executed
      regardless if the validator fails or not. I tested it in IE, FireFox, and
      Safari and got similar results.

      Is OnSubmitStateme nt supposed to execute AFTER validators and only if the
      validators are successful? I can't find any reference to it in the on-line
      docs. I'd appreciate any links.

      Thanks again,
      Bogdan


      "bruce barker" <nospam@nospam. comwrote in message
      news:%23uBL0Bay IHA.2208@TK2MSF TNGP04.phx.gbl. ..
      use ClientSCriptMan ager.RegisterOn SubmitStatement
      >
      -- bruce (sqlwork.com)
      >
      Bogdan wrote:
      >Hi,
      >>
      >I'd like to display (i.e. make visible) a label after a submit button is
      >clicked but only if the client-side validation is successful. If I did
      >not care about the validation then I'd simply modify style.display of the
      >label in my onclick (OnClientClick) script. The problem is that my
      >script will execute before the validation script.
      >Is there a way to execute my custom script after the validation takes
      >place?
      >>
      >Thanks,
      >Bogdan
      >>

      Comment

      Working...