Make the datepicker input editable


#1

Hi
I have some datepiker in my form, and I need to make de input of the datepiker editable, so that user can type date respecting the format.

This is my script.

var filtredate = new dhx.Form(“filtre_container”, {
cols: [
{
type: “datepicker”,
label: "Début: ",
labelInline: true,
labelWidth: “50px”,
value: “01/01/01”,
width :“150px”,
date:“20/02/20”,
name: “debut”
},
{
type: “datepicker”,
label: “Fin: “,
labelInline: true,
labelWidth: “50px”,
value: “30/03/20”,
width :“150px”,
name: “fin”
}
]
});
filtredate.events.on(“Change”, function(id,e){
if(id == “fin”)
{
window.location.href = “index2.php?debut=”+filtredate.getValue().debut+”&fin=”+filtredate.getValue().fin;
}
});


#2

Please, try to use the “editable” property of the datepicker:
https://snippet.dhtmlx.com/xqgip2m7
It is documented here:
https://docs.dhtmlx.com/suite/form__calendar.html


#3

Thank you sematik
it work fine


#4

please, what can I do to keeps the current date by default, in my input ?
Thank you.


#5

Set value property of datepicker control to Date() object, see snippet:
https://snippet.dhtmlx.com/7sc6hsgu


#6

Thank you very much proldapru


#7

Please another asking of help,
I want to attach Form in the dhxWindow, this below is my code, but it never work.

var dhxWindow = new dhx.Window({
title: “Configuration des mails planifiés”,
modal: true,
resizable: true,
//css:“planmail”,
header: true
});
dhxWindow.attach(“Form”,plform);
var plform = new dhx.Form(“adressemailcontainer”, {
cols: [
{
type: “textarea”,
value: “Some nice text”,
placeholder: “i am textarea”,
width:“200px”,
height: “150px”
},
{
type: “button”,
value: “ENREGISTRER”,
size: “medium”,
view: “flat”
}
]
});

What is wrong in my code ?, can you help me please.


#8

First create Form in null container, then create Window and attach Form to it. See snippet:
https://snippet.dhtmlx.com/kjfpxhdc


#9

Thank you proldapru.