usercontrol and clientside validation

K

Ken

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
 
P

psb

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top