Make the datepicker input editable

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;
}
});

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

Thank you sematik
it work fine

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

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

Thank you very much proldapru

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.

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

Thank you proldapru.

Hi proldapru,
I’m coming to ask for a little bit of your precious time, for another problem.
I want to know how can initialyse the textarea of my form with data from a json file.

This is what I do, but its not work.

plform = new dhx.Form(“null”, {
rows: [
{
type: “textarea”,
value: “includes/bruno.json”,
width:“900px”,
height: “250px”
},
{
type: “button”,
value: “ENREGISTRER”,
size: “medium”,
view: “flat”
}
]
});

Thank you

Unfortunately such complex content is not supported.
You may try to perform the ajax request, and insert the the response in the value of your textarea

It is a small content, 60 caracters only . I want to do it with json file, can you help me completing my following code

plform = new dhx.Form(“null”, {
rows: [
{
type: “textarea”,
value: “includes/bruno.json”,
width:“900px”,
height: “250px”
},
{
type: “button”,
value: “ENREGISTRER”,
size: “medium”,
view: “flat”
}
]
});

I try to perform the ajax request, but in the textarea field the message [object Promise] is display.

plform = new dhx.Form(“null”, {
rows: [
{
type: “textarea”,
value: dhx.ajax.get(“PHPMailer/email.json”),
name:“destinataires”,
width:“900px”,
height: “250px”
},
{
type: “button”,
value: “ENREGISTRER”,
size: “medium”,
view: “flat”
}
]
});

dhx.ajax.get("PHPMailer/email.json").then(function (data) {
plform = new dhx.Form(“null”, {
rows: [
{
type: “textarea”,
value:data ,
name:“destinataires”,
width:“900px”,
height: “250px”
},
{
type: “button”,
value: “ENREGISTRER”,
size: “medium”,
view: “flat”
}
]
});
});

Hi sematik
Your code indicates an error in this place plform = new dhx.Form(“null”, {
.
I have already searched everywhere, but without success.

Error message : Uncaught SyntaxError: Unexpected token ‘.’

Try null without any quotation marks:
let plform = new dhx.Form(null, { ... });

null in this case is a JavaScript object.

I remove the quotation marks in null, but the error still persit

Uncaught SyntaxError: Unexpected token ‘.’

I think, you have to replace all nonstandard quotes ( “ ) in your code to standard double (") or single (’) quotes. Maybe software of this forum distorts quotes.

It is what I do at the first time.

the error indicate the error in the following code

plform = new dhx.Form(null, {

@futuredba: Unfortunately, I could not execute dhx.ajax in the snippet tool, so I attach an archive with two demo files: demo.zip (250.2 KB). Everything works as expected.

@sematik: Is it possible to make dhx.ajax in the snippet tool?