ValidDate not working when using type calendar

When using a type calendar in a form, ValidDate doesnt validate. I want users to be able to write their dates or to select from the calendar, so readonly is not an option. Also, when calendar is readonly you cant delete the selected date.

Thank you for your help.

Hi

ValidDate works with strings, for calendar use custom validate function
validate: function(v){return (v instanceof Date);} for example

Hi Andrei,

Thank you for your response.

I was trying also to use a custom validation rule, but it is not being triggered.

//Valida que la fecha enviada sea valida
function validaFecha(value)
{
	return dhtmlxValidation.isValidDate(value);
}

Would it be possible to enable backspace in a readonly calendar to erase de selected date? That would be a valid solution. Also is it possible to display calendar popup on input focus?

Thank you very much for your time.

Hi

dhtmlxValidation.isValidDate check if string (not date obj) is match to 0000-00-00 to 9999-12-31, but in calendar date is a date obj and you can specify different mask for date

Would it be possible to enable backspace in a readonly calendar to erase de selected date?
decide - readonly or use backspace

Also is it possible to display calendar popup on input focus?
do you mean when user press tab button while in prev field and calendar gets focus? if you click it should appear by the default