usercontrol and clientside validation

Discussion in 'ASP .Net Building Controls' started by Ken, Jan 9, 2004.

  1. Ken

    Ken Guest

    Hi there,
    I have a usercontrol and i have written sone clientside
    validation script associated along with it. Now when i
    register this usercontrol in the mainwebform, how can i
    access the clientside validation to validate the
    usercontrol?

    Thanks in advance

    -K
    Ken, Jan 9, 2004
    #1
    1. Advertising

  2. Ken

    psb Guest

    if i know I will never add any more controls to the page I will let the page
    render. then I will look at the source. your elements will have id's like
    "_ctl45_txbZipCode" or "_ctl45_txbName". I would then use these as the name
    to validate against...

    if (document.Form1['_ctl45_txbName'].value.length == 0) return false;

    **NOTE: if you add controls to the page the "ctl45" may change to "ctl46"
    and so on. so when updateing the page, make sure the javascript validation
    code works.

    whatever. sorry if this is not what you are talking about....

    -psb

    "Ken" <> wrote in message
    news:01c101c3d6de$8fe773e0$...
    > Hi there,
    > I have a usercontrol and i have written sone clientside
    > validation script associated along with it. Now when i
    > register this usercontrol in the mainwebform, how can i
    > access the clientside validation to validate the
    > usercontrol?
    >
    > Thanks in advance
    >
    > -K
    psb, Jan 14, 2004
    #2
    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. Eddie Dodd

    Clientside validation not working

    Eddie Dodd, May 26, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    458
    Eddie Dodd
    May 27, 2004
  2. Dennis Calla

    Clientside validation not working.

    Dennis Calla, Jan 13, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    424
    Peter Blum
    Jan 13, 2005
  3. Paul
    Replies:
    1
    Views:
    2,072
    Scott Allen
    May 25, 2005
  4. Kris
    Replies:
    1
    Views:
    598
    Peter Blum
    Jun 30, 2005
  5. Roger Kjærnsrød

    Clientside validation with .NET Validator classes and Opera

    Roger Kjærnsrød, Apr 30, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    126
    Roger Kjærnsrød
    May 1, 2004
Loading...

Share This Page