I'm trying to write javascript code to set a date field value during a form's onOk event. I'm running into a type mismatch error. I'm using the following code:
function myEvent_onOk() {
var oFields, oDate;
oFields = ThisEvent.Object.Fields;
oDate = new Date();
oFields("CREATED_ON").Value = oDate.toString(); // I've also tried oFields("CREATED_ON").Value = oDate;
}
When I perform a typeof(oFields("CREATED_ON").Value), the typeof operator returns a type date, which AFAIK isn't a typical javascript type. Doing a typeof(oDate) returns type object.
Any ideas how to get around this?
Thanks,
Daniel