Hello,
PHPRunner 5.2 build 5482. Browser is firefox (3.5.7)
I have a datefield on an Add/Edit page.
On the event editor I have assigned a 'Simple edit box with datepicker' to this datefield and the dateformat is Dutch (DD-MM-YYYY).
I want to make this date in the right format if it isn't entered in the right format. (01042010 ==> 01-04-2010)
I made a JavaScript in the JavaScript on load event using the instructions:
-----------------------------------------------------------------------
var ctrlKoopdatum = Runner.getControl(pageid, 'Koopdatum');
function maakDatumOp() {
var datum = ctrlKoopdatum.getValue();
alert(ctrlKoopdatum.getValue());
if (datum.length == 8) {
datum = datum.substr(0,2) + "-" + datum.substr(2,2) + "-" + datum.substr(4,4);
ctrlKoopdatum.setValue(datum);
}
ctrlKoopdatum.setValue(datum);
};
ctrlKoopdatum.on('onchange', maakDatumOp);
-----------------------------------------------------------------------
The alert is to check the value of the date. If I change this date, the date becomes empty. The result of the method ctrlKoopdatum.getValue() is empty.
When I look with firebug I see that there already is a JavaScript on Koopdatum: the datepicker
Is it possible to create my own JavScript on Koopdatum or must I do it in another way?
Greetings,
Jo van Duin