CRÉER UNE BOITE DE DIALOGUE (INPUTBOX) AVEC CHOIX D'UNE DATE

Ce script permet d'inclure une zone formattée en date dans une boite de dialogue. La valeur est recueillie par la fonction getInputBoxValue


Il suffit de lancer cette fonction


function inputBoxDate() {
  var html = HtmlService.createHtmlOutput(`
<html>
<style>
  input[type="date"] {
    font-family: Roboto, Arial, sans-serif;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.6rem 0.7rem;
    background: #f3f3f3;
    border: none;
    font-size: 1.08rem;
    border-radius: 0.4rem;
  }
</style>
<body>
<input type="date" name="date" id="date" value="" onchange="retourner(this.value);">
</body><script>
window.close = function(){window.setTimeout(function(){google.script.host.close()},100)};
function retourner(valeur) {
  google.script.run.getInputBoxValue(valeur);
  close();
}
</script>
</html> 
  `)
    .setWidth(250).setHeight(100);
  SpreadsheetApp.getUi().showModalDialog(html"Renseigner ...");
}

et poursuivre le script avec

function getInputBoxValue(valeur) {
  Browser.msgBox(valeur)
  // suite du script
}

cette fonction est lancée automatiquement lorsque la date est sélectionnée

Commentaires

Posts les plus consultés de ce blog

INSÉRER UN TABLEAU PROVENANT D'UNE FEUILLE DANS UN COURRIEL

METTRE À DISPOSITION DES INFORMATIONS SANS ACCÈS AU FICHIER COMPLET

NAVIGUER AU SEIN D'UN FICHIER À L'AIDE D'UN MENU DÉROULANT