RequiredFieldValidators and user control required fields?

G

Guest

Hi,
I'm using .NET 1.1 and wondering if I can use RequiredFieldValidators with
required fields inside user controls.

The page is a type of tabbed panel layout with the divs show/hidden using
javascript. Depending on which tab panel is visible upon the submit, I want
to execute the appropriate javascript validation.

When I submit the form, is there a way to conditionally check or fire the
requiredfieldvalidators? Do you place the regfieldvalidator on the .aspx and
reference the control to validate as Control:FormField?

I can write the js to validate manually but was wondering if there is a
slick way of doing this. Thanks.
 
S

S. Justin Gengo

Dave,

You'll have to write a bit of javascript yourself because of the way your
are hiding/showing your tabs. If you'd used panels so that the various
unseen sections weren't actually there in code on the page then the required
field validators would work out of the box for you. But using panels would
require post backs each time one is switched to.

The required field validators all have an enabled property when created
client side. You should be able to set each control's enabled value to true
or false based on your tab change.

Regards,

Justin
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top