vdboor
vdboor

Reputation: 22526

How can I use the client-side validation of a RequiredFieldValidator in combination with my custom usercontrol?

Using the ValidationProperty I've managed to connect a RequiredFieldValidator with my custom control. When I enable client script in the validator, JavaScript errors occur.

Is there a way to tell the RequiredFieldValidator how it can validate my custom control in the client?

Upvotes: 1

Views: 526

Answers (1)

brumScouse
brumScouse

Reputation: 3226

In the first instance ensure the ControlToValidate property is pointing at the control you wish to validate.

Worryingly the JavaScript error is a bit weird as using RequiredFieldValidator would emit the stock ASP.NET validation code.

You could used a Custom Validator where you define the JavaScript method you want to execute to perform the validation.

Upvotes: 1

Related Questions