Hello,
I’ve been trialling the DHTMLX product suite for a few days now, and am generally very impressed by it so far.
However, I’ve run across one small problem, which I hope you might help me solve.
I’ve created a dhtmlxForm which includes a popup dhtmlxCalendar wired to an input field.
Everything works correctly, except that the input field’s isValidDate method considers the calendar’s date format of mm-dd-yyyy to be invalid. A date format of yyyy-mm-dd, however, is successfully validated.
The input field is defined within the form as:
type: "input",
name: "Target Date",
label: "Target Date (mm-dd-yyyy)",
value: "",
width: "100",
validate: "custom_targetDate"
The input field’s validation function is:
function custom_targetDate(value) {
if (!dhtmlxValidation.isValidDate(value))
return "A valid date must be entered";
return true;
And finally, the calendar is instantiated and wired to the input field thusly:
dhtmlXForm.prototype.items.input.showCalendar = function(item) {
var inp = item.childNodes[0].childNodes[1].childNodes[0];
inp.onclick = function(e){
e = e||event;
e.cancelBubble = true;
e.returnValue = false;
if (!myCalendar) {
myCalendar = new dhtmlXCalendarObject(this, true);
myCalendar.setDateFormat("%m-%d-%Y");
myCalendar.show();
}
return false;
};
};
myForm.doWithItem("Target Date", "showCalendar");
Thank you very much for any assistance you might offer.