Welcome Guest Search | Active Topics | Sign In | Register

DatePicker & MaxVaildDate Options
Loren Dorez
Posted: Thursday, July 9, 2009 5:54:32 PM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
Hi,

im Using a Datepicker and on the server side i set the MaxValidDate to example 01/01/01 and then I use some validators to make sure the date doesnt exceed 01/01/01. However if you type into the textbox 09/09/09 it immediately convert it to the MaxValidDate which will cause issues with my Validators. When a user enters a date OUTSIDE THE RANGE in the textbox is a Error throw or anything? if not this would be a great addon because you then cant use RangeValidator is you set the MaxValidDate to the same thing. Is there a workaround im missing?
eo_support
Posted: Friday, July 10, 2009 9:29:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can always use RangeValidator directly on DatePicker:

http://doc.essentialobjects.com/library/1/calendar/validator.aspx

Thanks
Loren Dorez
Posted: Friday, July 10, 2009 10:46:06 AM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
As i stated above i am using a RangeValidator on the DatePicker. However, i also wanted to lock down the popup calendar by setting the MaxValid Date and MinimumValid Date attributes. But all that happens if you exceed either is it gets set to those. Wouldnt this be like a built-in validator almost all that would need to be added is a Message or alert to be thrown. What is MaxValid & MinimumValid dates used for in real life senerios if they checnge them selves to the Max Dat if out of Range?
eo_support
Posted: Friday, July 10, 2009 11:24:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I think I do get what you are trying to do. MaxValidDate and MinValidDate are used to provide a simple range validation solution with no code at all. For people want more complicated logics like you, you would use RangeValidator and code for whatever logic along with it. There is generally no need to use both.

The only difference is that when you use RangeValidator, user will be able to select date outside of the valid range but then of course will be caught by your RangeValidator (where as with MaxValidDate and MinValidDate, dates outside of the range are grayed out). However we view this as the correct behavior because it maintains the consistence between the textbox and the picker drop down.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.