requiredfieldvalidator driving me nuts!!

P

Pat

i have some checkboxes ,dropdownlist and radio button on a page...
When the user get to the radio button its has a question and a user must
select YES or NO
If Yes then a Textbox appears and the submit button appears too and i have a
validation on it and it must be filled.
If No it just shows a text with the submit button and text saying blah
blah ..
My problem is this when the USER anwers No and the text appears with No
Textbox visible and i press the submit button it
shows the ErrorMessage of the "requiredValidator of the textbox" (but the
user isn't seeing the textbox since i have set it to visible="FALSE"

But on my other machine it works fine..
One thing again is that on my machine that works fine i don't have
Page.IsValid set.

Sometimes i noticed that the validators work without setting Page.IsValid
and sometimes you have to set it to work..
Any ideas..
 
M

Mark

Just an idea, are you using smart navigation on your page?? I know sometimes
the smart navigation feature causes havoc with the .NET validators
 
A

Adam Knight

I hope i have understood your question correctly.

This may be simplistic, but if by pressing no, no validation needs to occur
I can see two options.

1) myRequiredFieldValidator.Enabled = False
2) mySubitButton.CausesValidation = False

I hope i am not to far off?

Adam
 
P

Pat

Adma thx for the hint i also tried that before but i get Error:-

Page.IsValid cannot be called before validation has taken place. It should
be queried in the event handler for a control with CausesValidation=True or
after a call to Page.Validate.
 

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,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top