Hello,
I would like to add a Date picker filed in a panel, OIS101, for instance. I created the following script, but the date picker is enable and empty, till i click on it. Then it's becoming disable but with the today's date.
Any clue how to initilaize the datepicker with a date and display only ?
Thanks.
H5AddUID1.prototype.addDatePicker1 = function () {
var name = "testDatepicker";
// Valeur 6 caractères (DDMMYY)
var value6 = "200426"; // 20/04/26
var userContext = ScriptUtil.GetUserContext();
var dtfm = userContext["DTFM"]; // format user (ex: DMY / MDY / YMD etc.)
var textElement = new TextBoxElement();
textElement.Name = name;
textElement.Position = new PositionElement();
textElement.Position.Top = 23;
textElement.Position.Left = 50;
textElement.Position.Width = 8;
textElement.IsEnabled = false;
textElement.DateFormat = dtfm;
textElement.Value = value6;
if (ScriptUtil.version >= 2.0) {
textElement["type"] = 5;
textElement["dateFormat"] = dtfm
.replace(/Y/gi, "YY")
.replace(/M/gi, "MM")
.replace(/D/gi, "DD"); // => toujours 6
}