|
Rank: Member Groups: Member
Joined: 12/5/2007 Posts: 27
|
Hello,
I'm running into problems with DatePicker when I reset the form via Javascript by document.form1.reset(). This seems to cause the DatePickers to go to 1/1/1 ... only in IE7 !! and all this happens since I installed your 2008_36 build.
It works fine in FireFox.
Any hints on this one?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can't really treat the DatePicker as a simple textbox. When you call form1.reset to reset the form, the textbox are reset, but many internal variables maintained by the DatePicker are not. You can use the following code to reset the DatePicker:
Code: JavaScript
eo_GetObject("DatePicker1").setSelectedDate(null);
Thanks
|
|
Rank: Member Groups: Member
Joined: 12/5/2007 Posts: 27
|
I guess that would solve my problem, but how can I check whether the value has been changed by the user or not (is there a dirty flag)?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
THoMaSiN wrote:I guess that would solve my problem, but how can I check whether the value has been changed by the user or not (is there a dirty flag)? The DatePicker does not provide any direct support on that. You will need to implement your own mechanism to check whether the value has been changed. Just keep in mind to treat the DatePicker as a single object, not a DHTML element. This means you only use methods exposed by the DatePicker on the DatePicker (such as setSelectedDate). Anything that's not exposed by the DatePicker will not work. You can check the documentation for a complete list of what's exposed.
|
|
Rank: Member Groups: Member
Joined: 12/5/2007 Posts: 27
|
Thank you !! that's all the info that I required. Is there a chance to add a dirty member to query on Javascript to the feature requests?
Thanks again.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Thanks for your feedback. We have considered this feature before and decided against it. The reason is that in order for any dirty flags to work, there must be another "clear dirty flag" point. In another word, dirty is not absolute, it is always relative to a certain reference point. User will need to either set that reference point explicitly, or accept an implicit reference point (for example, when page is loaded). Requiring user to explicitly setting the reference point does not considerably simply the matter, which makes the feature almost useless. Using implicit reference point on the other hand has flexibility issues. The bottom line at here is that it’s fairly simple to check whether the value has been changed through user code because DatePicker holds a simple Date value. That’s why we decide to leave this part to end users.
Thanks
|
|