Forums

Chronoforms v5 : datepicker displayed below

GESign 20 Oct, 2016
I would need this solution as well, please.
It can be seen here: http://www.chronoengine.com/component/chronoforums/posts/f2/t98613.html
Thank you an d best regards,
Andrew
GreyHead 20 Oct, 2016
Hi Andrew,

I suggest that you use one of the jQuery datepickers where you have more control over the datepicker settings.

Bob
GESign 24 Oct, 2016
Dear Bob,

Thank you very much for your fast answer! I was thinking about this solution but I would like to use a different kind of date picker what uses a different kind of date picker. It works by data attribute:
<input type="text" data-uk-datepicker="{format:'DD.MM.YYYY'}">
I have tried this https://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/3678-how-can-i-add-an-attribute-to-a-form-input.html
but it doesn't work for me. I have a JS bug. I am not an expert in JS yet, maybe I missed something. It says the window.addEvent function is not valid. I took your code into "On load" part's "Load JavaScript" box. Do you know what did I miss, please.

Thank You and best regards,
Andrew
GreyHead 24 Oct, 2016
Hi Andrew,

In CFv5 you can add an Attribute in the Extra Params box of the TextBox element
data-uk-datepicker={format:'DD.MM.YYYY'}

Bob
GESign 24 Oct, 2016
Dear Bob,

Thank you for your answer.

The "from class to data attribute code" seems to me not working. I get this error code in Chrome browser even if I don't add any connected classes:
Uncaught TypeError: window.addEvent is not a function

I took your code in JS box to the top of "On load" part, above "HTML (Render Form)" box. What could cause this error message, please.
GreyHead 25 Oct, 2016
Hi Andrew,

That is a FAQ for CFv4 which used the MooTools JavaScript library. Current versions of Joomla! and ChronoForms use jQuery which is why the MooTools method window.addEvent is no longer working.

You don't need to use JavaScript to add an attribute in CFv5.

Bob
GESign 25 Oct, 2016
Dear Bob,

Thank you for your answer. I am so sorry for disturbed you. The "Extra params" field is for this job! Thank you and I beg your pardon! I hope this helps to others who switch of their brains for a moment.🙂
This topic is locked and no more replies can be posted.