Welcome Guest Search | Active Topics | Sign In | Register

DatePicker Selected date changed Options
Jimsurf
Posted: Thursday, June 17, 2010 5:34:09 PM
Rank: Newbie
Groups: Member

Joined: 6/16/2010
Posts: 4
Is the client side function that detects a changed date: ClientSideOnChange?
I created the following:ClientSideOnChange="OnRevisedDateChanged"

which should result in something like:
function OnRevisedDateChanged(sender, args)
{}

1) How do you remove a date from the control or set it to null on the browser?

If I attempt to erase the date from the control, I have to select each date portion individually, and use the backspace button. Doing so seems to cause the above event handler to fire once or twice, but it never fires when the date becomes blank. I would expect that the date changed event should fire if the date becomes null or empty, but it does not seem to do so?

I want to know how to recognize any date change including removal of the date. I don't see how your control supports that?
eo_support
Posted: Thursday, June 17, 2010 6:30:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Jimsurf wrote:
which should result in something like:
function OnRevisedDateChanged(sender, args)
{}

The argument list is wrong. See here for details about this handler:

http://doc.essentialobjects.com/library/1/jsdoc.public.handlers.clientside_generic_handler.aspx

Jimsurf wrote:
1) How do you remove a date from the control or set it to null on the browser?

If you do it manually, then yes, you must delete each portion individually (with backspace or del). If you do it with code, you can call this function with "null" argument:

http://doc.essentialobjects.com/library/1/jsdoc.public.calendar.setselecteddate.aspx


Jimsurf wrote:
If I attempt to erase the date from the control, I have to select each date portion individually, and use the backspace button. Doing so seems to cause the above event handler to fire once or twice, but it never fires when the date becomes blank.

This is normal. Any "incomplete" date is considered invalid thus is the same as "empty". For example, if you just delete the year part of a date, then getSelectedDate will return null meaning the DatePicker currently does not have a valid value.

Jimsurf wrote:
I want to know how to recognize any date change including removal of the date. I don't see how your control supports that?

Handle ClientSideOnChange is the correct way to do it. Inside your function you can call getSelectedDate to check whether the DatePicker has a valid value:

http://doc.essentialobjects.com/library/1/jsdoc.public.calendar.getselecteddate.aspx

As soon as you see it returns null, it means the DatePicker no longer has a valid date value. Note this does not mean all portions have been cleared.

Hope this helps.

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.