D
Dune
Hi there,
I have a user control and I need to carry out some client-
side custom validation on the controls within the user
control (hope that makes sense )
So I've stuck a CustomValidator into the page and set
ClientValidationFunction to the name of my javascript
validation function. But this is where I get lost...how
does one refer to the controls within the user control?
Referring to these internal controls using "document.forms
(0)..." seems wrong as there is no form within the user
control itself (as the user control will reside in the
form element of the web form that it is added to) and i've
tried it out and this indeed doesn't work.
So, this suggests to me that I can't carry out validation
using javascript within the user control itself, but must
instead, do the validation in the web form containing the
user control.
I have a bunch of these user controls on a web form which
is why it would be really nice to be able to make them do
their own validation, but if I have to validate them in
the web form, I guess I'll need to iterate through them
somehow?
Any suggestions?
Cheers
I have a user control and I need to carry out some client-
side custom validation on the controls within the user
control (hope that makes sense )
So I've stuck a CustomValidator into the page and set
ClientValidationFunction to the name of my javascript
validation function. But this is where I get lost...how
does one refer to the controls within the user control?
Referring to these internal controls using "document.forms
(0)..." seems wrong as there is no form within the user
control itself (as the user control will reside in the
form element of the web form that it is added to) and i've
tried it out and this indeed doesn't work.
So, this suggests to me that I can't carry out validation
using javascript within the user control itself, but must
instead, do the validation in the web form containing the
user control.
I have a bunch of these user controls on a web form which
is why it would be really nice to be able to make them do
their own validation, but if I have to validate them in
the web form, I guess I'll need to iterate through them
somehow?
Any suggestions?
Cheers