|
Rank: Newbie Groups: Member
Joined: 9/24/2007 Posts: 9
|
We are replacing texbox controls with the datepicker controls from EssentialObjects. The textbox controls simply held a date such as "9/9/2007" or "09/09/2007" which was received from the user. These controls were validated by an ASP.NET RegularExpressionValidator control which had an expression linked to it. Everything worked fine..
After changing to the EO DatePicker control, the validation controls don't seem to have any effect on it. We can enter an invalid date for the datePicker and no error is thrown. Everything has been setup properly - the 'controltovalide' property of the ReqularExpressionValidator has been set to the value of the datepicker and the ValidationGroup is set to fire when the submit button is clicked.. Everything is setup properly, we have ensured it.
My question is, why won't this work with the ASP.NET validation controls?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, Our DatePicker does work with ASP.NET validators. However, unlike a standard text box, the "value" of the control is not its contents text. It's the date value formatted in a certain way. Please see this page for details about how to use our controls with validators: http://www.essentialobjects.com/ViewDoc.aspx?t=Calendar%2fvalidator.htmlYou don't need to use RegularExpressionValidator to validate the DatePicker control. Just use appropriate DatePicker properties should help you prevent user from entering an invalid date at the very first place. Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 8/9/2007 Posts: 59
|
Hi There,
I had the same issue about Validators. Actually i didnt want to use even the Validators of Microsoft.
Yes till an extend, the Datepicker supports you to enter correct date. But I was really expecting the Datepicker to have all the Validators within the Product.
Its just a Suggestion, i believe its not so hard to add the RequiredField and RegularExpression Validator within the Datepicker itself, so we dont have to use the Microsoft Validators.
Thanks
Cheers
Menon
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi Menon,
Can you point out specific scenarios where our DatePicker + MS Validator won't be sufficient? Our DatePicker does work with MS validators. So if you can point out a few specific scenarios, it will greatly help us as to where we should put our focus on if we do implement additional validators.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/21/2007 Posts: 11
|
I haven't had any luck with any of the .NET Validators either. I have tried both range and compare validators. Could you post a sample ? The link you provided seems to address keeping dates with a certain range or using the control for inputting time of day. These are fine but don't really seem to address what the original question was...(how do you make certain the user isn't able to submit an invalid date...(like say "cat" or "dog" )
You have also said that if the developer accesses the proper properties of the control so that he/she can prevent the user submitting an invalid date. Can you go into detail (or provide a sample ) on which properties to access and what values those properties should be set to. Any advice or direction would be most appreciated.
Jason
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
For example, you can use RangeValidator to validate a DatePicker by setting MinimumValue to "2012-01-01" and MaximumValue to "2013-12-31", then user will only be able to enter dates in year 2012 and 2013.
The property we meant are properties such as MinValidDate, MaxValidDate, DisabledDates, etc. Those properties can be used to control what date users are allowed to enter.
Thanks!
|
|