RequiredFieldValidator

  • Thread starter Thread starter Trond
  • Start date Start date
T

Trond

I have an ASP.NET page with various textboxes, checkboxes and a date picker.
Attached to some of these controls i have RequiredFieldValidator. One of the
textboxes has a button next to it. When clicking a calender object is
opening and allows the user to select a date. When clicking that button the
RequiredFieldValidators triggers. So i added some code to the calender
button event :
RequiredFieldValidator2.Enabled = false;
RequiredFieldValidator1.Enabled = false;

But this is no good since validation is clientside. Is there a way i can
solve this? In other words toggle on and off validators in code so that they
dont trigger before the submit button is clicked

Best regards
Trond
 
In asp.net you can use the validationgroup property for validators (or set
CausesValidation property of the button to false). This will solve your
problem.
Why not using an image or link instead of a button for the calendar?

Hope this helps,
Arjen
 
....asp.net... in asp.net 2.0




Arjen said:
In asp.net you can use the validationgroup property for validators (or set
CausesValidation property of the button to false). This will solve your
problem.
Why not using an image or link instead of a button for the calendar?

Hope this helps,
Arjen
 
Thank you. Sometimes the solution to problems are so simple, but so hard to
find :-)
Best regards
Trond
 

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

Back
Top