- Posts: 38
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
2013-03-10T02:00
<script> // section remplacement du widget document.addEventListener("DOMContentLoaded", function () { // Sélectionner l'élément input existant const oldInput = document.querySelector('input[id="answer765636X772X32778"]'); if (oldInput) { // Crée un nouvel input de type datetime-local const newInput = document.createElement("input"); newInput.type = "datetime-local"; newInput.className = "form-control"; newInput.name = oldInput.name; newInput.id = oldInput.id; newInput.setAttribute("aria-labelledby", oldInput.getAttribute("aria-labelledby")); if (oldInput.value) { newInput.value = oldInput.value; } // Remplace l'ancien input par le nouveau oldInput.parentNode.replaceChild(newInput, oldInput); } }); // activer zone input si on clique sur le calendrier document.addEventListener("DOMContentLoaded", function () { const input = document.querySelector('input[type="datetime-local"]'); input.addEventListener("click", function () { this.focus(); // assure le focus même si l’icône est cliquée }); }); </script> <style type="text/css">#question32778 .form-control { width:200px; } #question32778 input[type="datetime-local"] { cursor: text; } #question32778 input[type="datetime-local"]::-webkit-calendar-picker-indicator { cursor: pointer; transform: scale(1.4); color: #1f6ab1; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.
What is a format directly readable?I send detailed notifications to certain users, which then trigger actions on their part, so the format needs to be directly readable.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.