Donnez vie à vos documents numériques !
 

Répondre à : Liste MEre Fille – que faire du bout de code ?

abracadabraPDF Forums PDF – Général Liste MEre Fille – que faire du bout de code ? Répondre à : Liste MEre Fille – que faire du bout de code ?

#69424
Justy
Participant

j’ai ajouter les virgulesmais ils continue de bloquer sur la même ligne

Code:
        [“Bu”, “export Lo1”],
Code:

/*
LICENSE:
acrojs_dependentList.js by Joel Geraci is licensed under a Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/

You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose, even commercially.

Setup:
For list boxes:  Add this script to the “selection change” script of the master list box.
For combo boxes: Add this script to the “custom format” script of the dropdown box.

IMPORTANT!
Edit the following line to identify the field name of the dependent list box then edit the properties of the dependentListValues JSON object. Property names should correspond to the export values of the list items.
*/
var dependentListBoxFieldName = “ListeFille”;
var dependentListValues =
{
    “Clés”: [
        [“PG”, “export C1”],
        [“PP”, “export C2”],
        [“CBI”, “export C3”],
        [“PAC”, “export C4”],
        [“A(à préciser)”, “export C5”],
    ],
    “Badges”: [
        [“CA”, “export B1”],
        [“Ca”, “export B2”],
        [“Co”, “export B3”],
        [“A(àpréciser)”, “export B4”],
    ],
    “Matériels”: [
        [“Tel”, “export Ma1”],
        [“Ord”, “export Ma2”],
        [“Ta”, “export Ma3”],
        [“Im”, “export Ma4”],
        [“EV”, “export Ma5”],
        [“VP”, “export Ma6”],
        [“RS”, “export Ma7”],
        [“C(à préciser)”, “export Ma8”],
        [“Autre (àpréciser)”, “export Ma9”],
    ],
    “Mobiliers”: [
        [“Ves”, “export Mo1”],
        [“Bu/Ta”, “export Mo2”],
        [“AH”, “export Mo3”],
        [“AB”, “export Mo4”],
        [“A(à préciser)”, “export Mo5”],
        [“A( à préciser)”, “export Mo6”],
    ]
    “Locaux”: [
        [“Bu”, “export Lo1”],
        [“Ves”, “export Lo2”],
        [“Re/St”, “export Lo3”],
        [“Ac/De”, “export Lo4”],
        [“A( à préciser)”, “export Lo5”],
    ]
};
/*
You probably don’t need to change anything from here down
*/
if ((event.target.type == “combobox” && event.name == “Format”) || (event.target.type == “listbox” && event.name == “Keystroke”)) {
    if (event.target.type == “combobox”) {
        if (dependentListValues.hasOwnProperty(event.target.value)) {
            this.getField(dependentListBoxFieldName).setItems(dependentListValues[event.target.value]);
        }
        else {
            this.getField(dependentListBoxFieldName).clearItems();
        }
    }
    if (event.target.type == “listbox” && dependentListValues.hasOwnProperty(event.changeEx)) {
        this.getField(dependentListBoxFieldName).setItems(dependentListValues[event.changeEx]);   
    }
}
else {
    app.alert(“This script was not intended for this field type or event.”);   
}