Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mike on Apr 24, 2009 06:33
open dhtmlx forum
Clearing Calendar date value

Hello,

I am using the DHTMLCalendar attached to a readonly textfield, as in many of your examples. However, I can find no way for the user to clear the date field (ie. set it to empty) after having selected it. Do I need to create a custom control with a custom javascript function to do this, or is there a better (and easier) way that is integrated with the calendar object?

Thanks,
Mike
Answer posted by Alex (support) on Apr 24, 2009 07:00

Hello, 

Do you want to clear value of the input field ?

If you do, you can just set empty value to the input element:

document.getElementById("textfield_id").value=""; 

Answer posted by Mike on Apr 24, 2009 07:06
Yes, that is exactly what i want to do. I know how to do it, but I want the USER to be able to do it, so i need some action they can take to cause the field to be cleared out. I was hoping there was something built into the calendar control (like an option for a 'Reset' button or something), but if there is not, I will simply have create an additional anchor for each calendar text input so that the user can click it and clear out the field.
Answer posted by Alex (support) on Apr 24, 2009 07:32

Unfortunately, there is not built-in "reset" button in calendar.

Answer posted by Alex (support) on Apr 25, 2009 06:05

Hello,

Sorry for the misleading information. Actually calendar provides "C" button that clears an input.

The sample of usage is attached to the post http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=9224