Hi there
I am trying to save a form through the dataprocessor ( using form.save() ), but it seems the date format I set is not the format that is sent to the server side.
Here is how I set up the form element:
{type:“calendar”, name:“ValidFrom”, label:“Valid From”, labelAlign:“left”, required:true, validate:‘NotEmpty’, dateFormat: “%Y/%m/%d”, serverDateFormat: “%Y/%m/%d”, inputWidth:100, },
I have also used the form’s method to set the date format:
dhxFormDeal.setCalendarDateFormat(“ValidFrom”, “%Y/%m/%d”, “%Y/%m/%d”);
When tracing the events in the console I get this
dhxFormDeal_onValidateSuccess (input=ValidTo, value=Fri Jan 10 2014 18:00:00 GMT+0200 (South Africa Standard Time), result=true)
I even tried overriding the value before validation like so:
function dhxFormDeal_onBeforeValidate(id) {
console.log(‘dhxFormDeal_onBeforeValidate(id=’+id+’)’);
console.log(dhxFormDeal.getItemValue(‘ValidFrom’));
dhxCalendar = dhxFormDeal.getCalendar(‘ValidFrom’);
console.log(dhxCalendar.getDate(true));
dhxFormDeal.setItemValue=dhxCalendar.getDate(true);
return true;
}
Above output is:
dhxFormDeal_onBeforeValidate(id=undefined)
Sat Feb 01 2014 18:00:00 GMT+0200 (South Africa Standard Time)
2014/02/01
The reason this is a problem is because I am using CodeIgniter and that it is blocking the posting because of disallowed key characters.
Please let me know how I can get it to send the correct date format through form.save() or otherwise I will have to code the AJAX post manually
Thanks