abracadabraPDF › Forums › PDF – Général › Script couleur de fond d’un champ en fonction de son contenu › Répondre à : Script couleur de fond d’un champ en fonction de son contenu
Ce script figure bien dans “Tous les scripts”…Peut-être ne l’ai-je pas mis au bon endroit ?
//
//
//
/*********** appartient à : AcroForm:Combo Box1:Keystroke ***********/
if (event.willCommit)
{
var deptdata={
Lun:{Jour1:”Lu”,Jour2:”Ma”,Jour3:”Me”,Jour4:”Je”,Jour5:”Ve”,Jour6:”Sa”,Jour7:”Di”},
Mar:{Jour1:”Ma”,Jour2:”Me”,Jour3:”Je”,Jour4:”Ve”,Jour5:”Sa”,Jour6:”Di”,Jour7:”Lu”},
Mer:{Jour1:”Me”,Jour2:”Je”,Jour3:”Ve”,Jour4:”Sa”,Jour5:”Di”,Jour6:”Lu”,Jour7:”Ma”},
Jeu:{Jour1:”Je”,Jour2:”Ve”,Jour3:”Sa”,Jour4:”Di”,Jour5:”Lu”,Jour6:”Ma”,Jour7:”Me”},
Ven:{Jour1:”Ve”,Jour2:”Sa”,Jour3:”Di”,Jour4:”Lu”,Jour5:”Ma”,Jour6:”Me”,Jour7:”Je”},
Sam:{Jour1:”Sa”,Jour2:”Di”,Jour3:”Lu”,Jour4:”Ma”,Jour5:”Me”,Jour6:”Je”,Jour7:”Ve”},
Dim:{Jour1:”Di”,Jour2:”Lu”,Jour3:”Ma”,Jour4:”Me”,Jour5:”Je”,Jour6:”Ve”,Jour7:”Sa”},
};
if (event.value == ” “)
{
this.resetform([“Jour1″,”Jour2″,”Jour3″,”Jour4″,”Jour5″,”Jour6″,”Jour7”]);
}
else
{
cdepname=event.value;
this.getField(“Jour1”).value=deptdata[cdepname].Jour1;
this.getField(“Jour2”).value=deptdata[cdepname].Jour2;
this.getField(“Jour3”).value=deptdata[cdepname].Jour3;
this.getField(“Jour4”).value=deptdata[cdepname].Jour4;
this.getField(“Jour5”).value=deptdata[cdepname].Jour5;
this.getField(“Jour6”).value=deptdata[cdepname].Jour6;
this.getField(“Jour7”).value=deptdata[cdepname].Jour7;
}
}
Ce script ne fonctionne plus, il figure bien