var dynamicListContent = [{"fieldId":"fld_Country","type":"simple","formParentFieldId":"","data":[{"code":"472","name":"AFGHANISTAN"},{"code":"329","name":"AFRIQUE DU SUD"},{"code":"324","name":"ALBANIE"},{"code":"322","name":"ALGERIE"},{"code":"8","name":"ALLEMAGNE"},{"code":"321","name":"ANDORRE"},{"code":"327","name":"ANGOLA"},{"code":"323","name":"ANGUILLA"},{"code":"476","name":"ANTARCTIQUE"},{"code":"320","name":"ANTIGUA ET BARBUDA"},{"code":"326","name":"ANTILLES NEERLANDAISES"},{"code":"78","name":"ARABIE SAOUDITE"},{"code":"50","name":"ARGENTINE"},{"code":"325","name":"ARMENIE"},{"code":"330","name":"ARUBA"},{"code":"36","name":"AUSTRALIE"},{"code":"47","name":"AUTRICHE"},{"code":"53","name":"AZERBAIDJAN"},{"code":"51","name":"BAHAMAS"},{"code":"98","name":"BAHREIN"},{"code":"35","name":"BANGLADESH"},{"code":"331","name":"BARBADE"},{"code":"3","name":"BELGIQUE"},{"code":"339","name":"BELIZE"},{"code":"80","name":"BENIN"},{"code":"334","name":"BERMUDES"},{"code":"336","name":"BHOUTAN"},{"code":"48","name":"BIELORUSSIE"},{"code":"401","name":"BIRMANIE (MYANMAR)"},{"code":"335","name":"BOLIVIE"},{"code":"52","name":"BOSNIE-HERZEGOVINE"},{"code":"338","name":"BOTSWANA"},{"code":"49","name":"BRESIL"},{"code":"147","name":"BRUNEI"},{"code":"54","name":"BULGARIE"},{"code":"332","name":"BURKINA FASO"},{"code":"333","name":"BURUNDI"},{"code":"55","name":"CAMBODGE"},{"code":"345","name":"CAMEROUN"},{"code":"6","name":"CANADA"},{"code":"349","name":"CAP VERT"},{"code":"56","name":"CHILI"},{"code":"25","name":"CHINE"},{"code":"148","name":"CHYPRE"},{"code":"57","name":"COLOMBIE"},{"code":"343","name":"CONGO"},{"code":"387","name":"COREE DU NORD"},{"code":"84","name":"COREE DU SUD"},{"code":"346","name":"COSTA RICA"},{"code":"30","name":"COTE D'IVOIRE"},{"code":"10","name":"CROATIE"},{"code":"348","name":"CUBA"},{"code":"491","name":"DANEMARK"},{"code":"352","name":"DJIBOUTI"},{"code":"353","name":"DOMINIQUE"},{"code":"59","name":"EGYPTE"},{"code":"89","name":"EMIRATS ARABES UNIS (EAU)"},{"code":"355","name":"EQUATEUR"},{"code":"357","name":"ERYTHREE"},{"code":"19","name":"ESPAGNE"},{"code":"60","name":"ESTONIE"},{"code":"5","name":"ETATS-UNIS"},{"code":"358","name":"ETHIOPIE"},{"code":"359","name":"FIDJI"},{"code":"16","name":"FINLANDE"},{"code":"2","name":"FRANCE"},{"code":"363","name":"GABON"},{"code":"367","name":"GAMBIE"},{"code":"364","name":"GEORGIE"},{"code":"371","name":"GEORGIE SUD/ILES SANDWICH SUD"},{"code":"24","name":"GHANA"},{"code":"61","name":"GIBRALTAR"},{"code":"62","name":"GRECE"},{"code":"475","name":"GRENADE"},{"code":"366","name":"GROENLAND"},{"code":"369","name":"GUADELOUPE"},{"code":"373","name":"GUAM"},{"code":"372","name":"GUATEMALA"},{"code":"368","name":"GUINEE"},{"code":"370","name":"GUINEE EQUATORIALE"},{"code":"374","name":"GUINEE-BISSAU"},{"code":"375","name":"GUYANA"},{"code":"365","name":"GUYANE FRANCAISE"},{"code":"378","name":"HAITI"},{"code":"377","name":"HONDURAS"},{"code":"63","name":"HONG-KONG"},{"code":"64","name":"HONGRIE"},{"code":"337","name":"ILE BOUVET"},{"code":"350","name":"ILE CHRISTMAS"},{"code":"429","name":"ILE DE LA REUNION"},{"code":"408","name":"ILE MAURICE"},{"code":"379","name":"ILES ANGLO NORMANDES"},{"code":"388","name":"ILES CAIMANS"},{"code":"340","name":"ILES COCOS (KEELING)"},{"code":"344","name":"ILES COOK"},{"code":"360","name":"ILES FALKLAND"},{"code":"362","name":"ILES FEROE"},{"code":"376","name":"ILES HEARD ET MCDONALD"},{"code":"404","name":"ILES MARIANNES DU NORD"},{"code":"398","name":"ILES MARSHALL"},{"code":"460","name":"ILES MINEURES ELOIGNEES E.-U."},{"code":"414","name":"ILES NORFOLK"},{"code":"423","name":"ILES PITCAIRN"},{"code":"431","name":"ILES SALOMON"},{"code":"448","name":"ILES TURKS ET CAICOS"},{"code":"465","name":"ILES VIERGES (E.U.)"},{"code":"464","name":"ILES VIERGES (R.U.)"},{"code":"32","name":"INDE"},{"code":"66","name":"INDONESIE"},{"code":"381","name":"IRAK"},{"code":"94","name":"IRAN"},{"code":"67","name":"IRLANDE"},{"code":"65","name":"ISLANDE"},{"code":"26","name":"ISRAEL"},{"code":"11","name":"ITALIE"},{"code":"382","name":"JAMAIQUE"},{"code":"68","name":"JAPON"},{"code":"69","name":"JORDANIE"},{"code":"389","name":"KAZAKHSTAN"},{"code":"70","name":"KENYA"},{"code":"383","name":"KIRGHIZISTAN"},{"code":"384","name":"KIRIBATI"},{"code":"71","name":"KOWEIT"},{"code":"390","name":"LAOS"},{"code":"385","name":"LES COMORES"},{"code":"395","name":"LESOTHO"},{"code":"96","name":"LETTONIE"},{"code":"391","name":"LIBAN"},{"code":"394","name":"LIBERIA"},{"code":"396","name":"LIBYE"},{"code":"393","name":"LIECHTENSTEIN"},{"code":"97","name":"LITUANIE"},{"code":"18","name":"LUXEMBOURG"},{"code":"403","name":"MACAO"},{"code":"399","name":"MACEDOINE"},{"code":"72","name":"MADAGASCAR"},{"code":"410","name":"MALAWI"},{"code":"23","name":"MALAYSIE"},{"code":"409","name":"MALDIVES"},{"code":"400","name":"MALI"},{"code":"73","name":"MALTE"},{"code":"46","name":"MAROC"},{"code":"405","name":"MARTINIQUE"},{"code":"406","name":"MAURITANIE"},{"code":"469","name":"MAYOTTE"},{"code":"74","name":"MEXIQUE"},{"code":"361","name":"MICRONESIE"},{"code":"397","name":"MOLDAVIE"},{"code":"37","name":"MONACO"},{"code":"402","name":"MONGOLIE"},{"code":"93","name":"MONTÉNÉGRO"},{"code":"407","name":"MONTSERRAT"},{"code":"411","name":"MOZAMBIQUE"},{"code":"473","name":"NAMIBIE"},{"code":"417","name":"NAURU"},{"code":"75","name":"NELLE-ZELANDE"},{"code":"416","name":"NEPAL"},{"code":"415","name":"NICARAGUA"},{"code":"413","name":"NIGER"},{"code":"29","name":"NIGERIA"},{"code":"418","name":"NIUE"},{"code":"9","name":"NORVEGE"},{"code":"412","name":"NOUVELLE-CALEDONIE"},{"code":"79","name":"OMAN"},{"code":"459","name":"OUGANDA"},{"code":"461","name":"OUZBEKISTAN"},{"code":"34","name":"PAKISTAN"},{"code":"426","name":"PALAOS"},{"code":"419","name":"PANAMA"},{"code":"421","name":"PAPOUASIE NOUVELLE GUINEE"},{"code":"427","name":"PARAGUAY"},{"code":"12","name":"PAYS-BAS"},{"code":"76","name":"PEROU"},{"code":"81","name":"PHILIPPINES"},{"code":"14","name":"POLOGNE"},{"code":"420","name":"POLYNESIE FRANCAISE"},{"code":"424","name":"PORTO RICO"},{"code":"15","name":"PORTUGAL"},{"code":"77","name":"QATAR"},{"code":"342","name":"REPUBLIQUE CENTRAFRICAINE"},{"code":"428","name":"REPUBLIQUE CENTRE AFRIQUE"},{"code":"341","name":"REPUBLIQUE DEMOCRATIQUE CONGO"},{"code":"354","name":"REPUBLIQUE DOMINICAINE"},{"code":"95","name":"REPUBLIQUE SERBE"},{"code":"351","name":"REPUBLIQUE TCHEQUE"},{"code":"13","name":"ROUMANIE"},{"code":"7","name":"ROYAUME-UNI"},{"code":"489","name":"RUSSIE"},{"code":"430","name":"RWANDA"},{"code":"356","name":"SAHARA OCCIDENTAL"},{"code":"443","name":"SAINT BARTHELEMY"},{"code":"439","name":"SAINT MARTIN"},{"code":"463","name":"SAINT VINCENT & GRENADINES"},{"code":"434","name":"SAINTE-HELENE"},{"code":"392","name":"SAINTE-LUCIE"},{"code":"386","name":"SAINT-KITTS-ET-NEVIS"},{"code":"444","name":"SALVADOR"},{"code":"468","name":"SAMOA"},{"code":"28","name":"SAMOA (E.U.)"},{"code":"438","name":"SAN MARIN"},{"code":"442","name":"SAO TOME"},{"code":"83","name":"SENEGAL"},{"code":"347","name":"SERBIE ET MONTENEGRO"},{"code":"432","name":"SEYCHELLES"},{"code":"437","name":"SIERRA LEONE"},{"code":"31","name":"SINGAPOUR"},{"code":"58","name":"SLOVAQUIE"},{"code":"435","name":"SLOVENIA"},{"code":"440","name":"SOMALIE"},{"code":"433","name":"SOUDAN"},{"code":"85","name":"SRI LANKA"},{"code":"422","name":"ST. PIERRE ET MIQUELON"},{"code":"86","name":"SUEDE"},{"code":"17","name":"SUISSE"},{"code":"441","name":"SURINAM"},{"code":"436","name":"SVALBARD ET ILE JAN MAYEN"},{"code":"446","name":"SWAZILAND"},{"code":"445","name":"SYRIE"},{"code":"451","name":"TADJIKISTAN"},{"code":"447","name":"TAHITI"},{"code":"87","name":"TAIWAN"},{"code":"458","name":"TANZANIE"},{"code":"449","name":"TCHAD"},{"code":"380","name":"TERR. BRITANNIQUE OCEAN INDIEN"},{"code":"474","name":"TERRES AUSTRALES FRANCAISES"},{"code":"425","name":"TERRITOIRE PALESTINIEN OCCUPE"},{"code":"88","name":"THAILANDE"},{"code":"453","name":"TIMOR-LESTE"},{"code":"450","name":"TOGO"},{"code":"452","name":"TOKELAU"},{"code":"455","name":"TONGA"},{"code":"456","name":"TRINITE-ET-TOBAGO"},{"code":"149","name":"TUNISIE"},{"code":"454","name":"TURKMENISTAN"},{"code":"27","name":"TURQUIE"},{"code":"457","name":"TUVALU"},{"code":"90","name":"UKRAINE"},{"code":"91","name":"URUGUAY"},{"code":"466","name":"VANUATU"},{"code":"462","name":"VATICAN"},{"code":"33","name":"VENEZUELA"},{"code":"92","name":"VIETNAM"},{"code":"467","name":"WALLIS ET FUTUNA"},{"code":"82","name":"YEMEN"},{"code":"470","name":"ZAMBIE"},{"code":"471","name":"ZIMBABWE"}]},{"fieldId":"fld_Category","type":"simple","formParentFieldId":"","data":[{"code":"167","name":"Atelier/RDV Naturopathie"},{"code":"90","name":"Commande en Ligne"},{"code":"25","name":"Nos magasins"},{"code":"1","name":"Nos produits"},{"code":"174","name":"Opération Bi-Eau"},{"code":"58","name":"Programme de fidélité"},{"code":"98","name":"Protection des données personnelles"}]},{"fieldId":"fld_SubCategory","type":"simple","formParentFieldId":"fld_Category","data":[{"code":"59","parentValue":"58","name":"Activer ma carte"},{"code":"168","parentValue":"167","name":"Ateliers Naturopathe"},{"code":"91","parentValue":"90","name":"Demande de Facture"},{"code":"27","parentValue":"25","name":"Demande d'informations"},{"code":"3","parentValue":"1","name":"Demande d'informations"},{"code":"178","parentValue":"174","name":"Demande information"},{"code":"62","parentValue":"58","name":"Fusionner deux cartes"},{"code":"60","parentValue":"58","name":"Mes points"},{"code":"63","parentValue":"58","name":"Modifier mon profil"},{"code":"92","parentValue":"90","name":"Mon compte E-commerce"},{"code":"61","parentValue":"58","name":"Perte ou vol de ma carte"},{"code":"152","parentValue":"98","name":"Protection des données personnelles"},{"code":"93","parentValue":"90","name":"Question concernant une commande"},{"code":"175","parentValue":"174","name":"Réclamation"},{"code":"94","parentValue":"90","name":"Réclamation concernant une commande"},{"code":"2","parentValue":"1","name":"Réclamations"},{"code":"26","parentValue":"25","name":"Réclamations"},{"code":"169","parentValue":"167","name":"Rendez-vous Naturopathe"},{"code":"95","parentValue":"90","name":"Retard de ma commande"},{"code":"181","parentValue":"174","name":"Retours Positif"},{"code":"29","parentValue":"25","name":"Retours positifs"},{"code":"4","parentValue":"1","name":"Suggestion"},{"code":"28","parentValue":"25","name":"Suggestion"},{"code":"64","parentValue":"58","name":"Supprimer mon compte de fidélité"}]},{"fieldId":"fld_WebFormProducts","type":"multiple","formParentFieldId":"","data":[]},{"fieldId":"fld_Origin","type":"simple","formParentFieldId":"","data":[]},{"fieldId":"fld_HeadCounts","type":"simple","formParentFieldId":"","data":[{"code":"","name":""},{"code":"","name":""},{"code":"","name":""},{"code":"","name":""},{"code":"","name":""}]},{"fieldId":"fld_Turnover","type":"simple","formParentFieldId":"","data":[{"code":"De 0 à 1 M€","name":"De 0 à 1 M€"},{"code":"De 1 à 5 M€","name":"De 1 à 5 M€"},{"code":"De 5 à 10 M€","name":"De 5 à 10 M€"},{"code":"De 10 à 50 M€","name":"De 10 à 50 M€"},{"code":"De 100 à 500 M€","name":"De 100 à 500 M€"},{"code":"De 500 à 1000 M€","name":"De 500 à 1000 M€"},{"code":"De 1000 à 10000 M€","name":"De 1000 à 10000 M€"}]},{"fieldId":"fld_Salutation","type":"simple","formParentFieldId":"","data":[{"code":"Mme.","name":"Madame"},{"code":"Mlle.","name":"Mademoiselle"},{"code":"Mr.","name":"Monsieur"}]},{"fieldId":"fld_CS_Zone","type":"simple","formParentFieldId":"","data":[{"code":"IDF","name":"Ile de France"},{"code":"PACA","name":"Provence Alpes Côte d'Azur"},{"code":"PACA2","name":"Languedoc Roussillon"},{"code":"AQUITAINE","name":"Aquitaine"},{"code":"OUEST","name":"Poitou Charentes"},{"code":"NORD","name":"Nord-Pas-de-Calais"},{"code":"NORD2","name":"Normandie"},{"code":"RHO","name":"Rhône Alpes"},{"code":"RHO2","name":"Bourgogne"},{"code":"MDP","name":"Midi Pyrénées"},{"code":"GEST","name":"Grand Est"},{"code":"BEL","name":"-- BELGIQUE --"},{"code":"BRU","name":"Bruxelles"},{"code":"SUI","name":"-- SUISSE --"},{"code":"LAU","name":"Lausanne"},{"code":"REN","name":"Renens"},{"code":"NYO","name":"Nyon"},{"code":"GEN","name":"Genève"}]},{"fieldId":"fld_CS_Shop","type":"simple","formParentFieldId":"fld_CS_Zone","data":[{"code":"237","parentValue":"PACA","name":"Bio c' Bon Nice Delfino"},{"code":"2","parentValue":"IDF","name":"Bio c' Bon Paris Balard"},{"code":"4","parentValue":"IDF","name":"Bio c' Bon Paris Lecourbe"},{"code":"5","parentValue":"IDF","name":"Bio c' Bon Vincennes"},{"code":"6","parentValue":"IDF","name":"Bio c' Bon Paris Acacias"},{"code":"7","parentValue":"IDF","name":"Bio c' Bon Paris Saint Lambert"},{"code":"8","parentValue":"IDF","name":"Bio c' Bon Paris Parmentier"},{"code":"9","parentValue":"IDF","name":"Bio c' Bon Levallois"},{"code":"10","parentValue":"IDF","name":"Bio c' Bon Les Lilas"},{"code":"11","parentValue":"IDF","name":"Bio c' Bon Paris Réaumur"},{"code":"13","parentValue":"IDF","name":"Bio c' Bon Paris Alésia"},{"code":"14","parentValue":"IDF","name":"Bio c' Bon Paris Championnet"},{"code":"15","parentValue":"IDF","name":"Bio c' Bon Paris Jaurès"},{"code":"16","parentValue":"IDF","name":"Bio c' Bon Paris Pigalle"},{"code":"17","parentValue":"IDF","name":"Bio c' Bon Paris Hauteville"},{"code":"19","parentValue":"IDF","name":"Bio c' Bon Le Raincy"},{"code":"20","parentValue":"IDF","name":"Bio c' Bon Vanves"},{"code":"21","parentValue":"IDF","name":"Bio c' Bon Paris Ternes"},{"code":"24","parentValue":"IDF","name":"Bio c' Bon Issy Les Moulineaux"},{"code":"28","parentValue":"IDF","name":"Bio c' Bon Paris Cerisaie"},{"code":"30","parentValue":"IDF","name":"Bio c' Bon Meudon"},{"code":"31","parentValue":"IDF","name":"Bio c' Bon Montreuil Croix De Chavaux"},{"code":"32","parentValue":"IDF","name":"Bio c' Bon Paris Renard"},{"code":"33","parentValue":"IDF","name":"Bio c' Bon Paris Bagnolet"},{"code":"35","parentValue":"IDF","name":"Bio c' Bon Paris Pyrénées"},{"code":"37","parentValue":"IDF","name":"Bio c' Bon Paris Félix Faure"},{"code":"40","parentValue":"IDF","name":"Bio c' Bon Paris Vavin"},{"code":"41","parentValue":"IDF","name":"Bio c' Bon Paris Bergère"},{"code":"44","parentValue":"IDF","name":"Bio c' Bon Paris rue de Meaux"},{"code":"47","parentValue":"IDF","name":"Bio c' Bon Boulogne Kermen"},{"code":"48","parentValue":"IDF","name":"Bio c' Bon Clamart"},{"code":"49","parentValue":"IDF","name":"Bio c' Bon Paris Turenne"},{"code":"51","parentValue":"IDF","name":"Bio c' Bon Montrouge"},{"code":"52","parentValue":"IDF","name":"Bio c' Bon Paris Général Leclerc"},{"code":"54","parentValue":"IDF","name":"Bio c' Bon Paris Saint Didier"},{"code":"55","parentValue":"IDF","name":"Bio c' Bon Paris Avenue d'Italie"},{"code":"58","parentValue":"IDF","name":"Bio c' Bon Paris Daumesnil"},{"code":"63","parentValue":"IDF","name":"Bio c' Bon Paris Glacière"},{"code":"64","parentValue":"IDF","name":"Bio c' Bon Paris Bourgogne"},{"code":"67","parentValue":"IDF","name":"Bio c' Bon Puteaux"},{"code":"68","parentValue":"IDF","name":"Bio c' Bon St-Maur-des-Fossés"},{"code":"69","parentValue":"IDF","name":"Bio c' Bon Sèvres"},{"code":"70","parentValue":"IDF","name":"Bio c' Bon Paris Grenelle"},{"code":"74","parentValue":"IDF","name":"Bio c' Bon Paris Paul Doumer"},{"code":"75","parentValue":"IDF","name":"Bio c' Bon Antony Briand"},{"code":"76","parentValue":"IDF","name":"Bio c' Bon Paris Picpus"},{"code":"78","parentValue":"IDF","name":"Bio c' Bon Paris Saint Martin"},{"code":"81","parentValue":"IDF","name":"Bio c' Bon Paris Voltaire"},{"code":"82","parentValue":"IDF","name":"Bio c' Bon Paris Poteau"},{"code":"84","parentValue":"IDF","name":"Bio c' Bon Paris Saint Dominique"},{"code":"92","parentValue":"IDF","name":"Bio c' Bon Paris Ledru Rollin"},{"code":"93","parentValue":"IDF","name":"Bio c' Bon Pantin"},{"code":"97","parentValue":"IDF","name":"Bio c' Bon Paris Saint Maur"},{"code":"98","parentValue":"IDF","name":"Bio c' Bon Bois-Colombes"},{"code":"215","parentValue":"IDF","name":"Bio c' Bon Caulaincourt"},{"code":"216","parentValue":"IDF","name":"Bio c' Bon Paris Saint André Des Arts"},{"code":"218","parentValue":"IDF","name":"Bio c' Bon Paris Daru"},{"code":"220","parentValue":"IDF","name":"Bio c' Bon Paris Saint Augustin"},{"code":"234","parentValue":"IDF","name":"Bio c' Bon Paris Kléber"},{"code":"50","parentValue":"IDF","name":"Bio c' Bon Versailles"},{"code":"60","parentValue":"IDF","name":"Bio c' Bon Garches"},{"code":"214","parentValue":"IDF","name":"Bio c' Bon St Germain-En-Laye"},{"code":"224","parentValue":"IDF","name":"Bio c' Bon Le Chesnay"},{"code":"230","parentValue":"IDF","name":"Bio c' Bon Asnières"},{"code":"232","parentValue":"IDF","name":"Bio c' Bon Suresnes"},{"code":"12","parentValue":"PACA","name":"Bio c' Bon Aix Briand"},{"code":"18","parentValue":"PACA","name":"Bio c' Bon Aix Belges"},{"code":"22","parentValue":"PACA","name":"Bio c' Bon Marseille Breteuil"},{"code":"23","parentValue":"PACA","name":"Bio c' Bon Marseille Mazargues"},{"code":"25","parentValue":"PACA","name":"Bio c' Bon Plan De Campagne"},{"code":"26","parentValue":"PACA","name":"Bio c' Bon Aix Gambetta"},{"code":"34","parentValue":"PACA","name":"Bio c' Bon Marseille Cours Julien"},{"code":"39","parentValue":"PACA","name":"Bio c' Bon Cannes Vauban"},{"code":"56","parentValue":"PACA","name":"Bio c' Bon Nice Gambetta"},{"code":"59","parentValue":"PACA","name":"Bio c' Bon Saint Raphaël"},{"code":"62","parentValue":"PACA","name":"Bio c' Bon Marseille Montaigne"},{"code":"72","parentValue":"PACA","name":"Bio c' Bon Marseille Blancarde"},{"code":"73","parentValue":"PACA","name":"Bio c' Bon Allauch"},{"code":"94","parentValue":"PACA","name":"Bio c' Bon Nîmes Allende"},{"code":"96","parentValue":"PACA","name":"Bio c' Bon Nice Clémenceau"},{"code":"201","parentValue":"PACA","name":"Bio c' Bon Marseille Castellane"},{"code":"202","parentValue":"PACA","name":"Bio c' Bon Montpellier Comédie"},{"code":"205","parentValue":"PACA","name":"Bio c' Bon Antibes"},{"code":"36","parentValue":"AQUITAINE","name":"Bio c' Bon Bordeaux Cours Victor Hugo"},{"code":"43","parentValue":"AQUITAINE","name":"Bio c' Bon Merignac"},{"code":"53","parentValue":"AQUITAINE","name":"Bio c' Bon Pessac"},{"code":"77","parentValue":"AQUITAINE","name":"Bio c' Bon Bordeaux Albret"},{"code":"91","parentValue":"AQUITAINE","name":"Bio c' Bon Langon"},{"code":"95","parentValue":"AQUITAINE","name":"Bio c' Bon Biganos"},{"code":"217","parentValue":"AQUITAINE","name":"Bio c' Bon Bouliac"},{"code":"221","parentValue":"AQUITAINE","name":"Bio c' Bon Bayonne Hugo"},{"code":"223","parentValue":"AQUITAINE","name":"Bio c' Bon Bordeaux Les Chartrons"},{"code":"42","parentValue":"OUEST","name":"Bio c' Bon La Rochelle-Lagord"},{"code":"46","parentValue":"OUEST","name":"Bio c' Bon Rochefort"},{"code":"57","parentValue":"OUEST","name":"Bio c' Bon Angoulême"},{"code":"66","parentValue":"OUEST","name":"Bio c' Bon Poitiers"},{"code":"87","parentValue":"OUEST","name":"Bio c' Bon Niort"},{"code":"38","parentValue":"NORD","name":"Bio c' Bon Lille Monnaie"},{"code":"45","parentValue":"NORD","name":"Bio c' Bon Lille Faidherbe"},{"code":"61","parentValue":"NORD","name":"Bio c' Bon Valenciennes"},{"code":"65","parentValue":"NORD","name":"Bio c' Bon Arras"},{"code":"88","parentValue":"NORD","name":"Bio c' Bon Rouen Carmes"},{"code":"90","parentValue":"NORD","name":"Bio c' Bon Cambrai"},{"code":"206","parentValue":"NORD","name":"Bio c' Bon Amiens"},{"code":"209","parentValue":"NORD","name":"Bio c' Bon Lille Lomme"},{"code":"211","parentValue":"NORD","name":"Bio c' Bon Rouen Saint Marc"},{"code":"212","parentValue":"NORD","name":"Bio c' Bon Lille Esquermoise"},{"code":"222","parentValue":"NORD","name":"Bio c' Bon Lille Solférino"},{"code":"228","parentValue":"NORD","name":"Bio c' Bon Lille Wasquehal"},{"code":"71","parentValue":"RHO","name":"Bio c' Bon Grenoble"},{"code":"79","parentValue":"RHO","name":"Bio c' Bon Lyon Garibaldi"},{"code":"83","parentValue":"RHO","name":"Bio c' Bon Aix-Les-Bains"},{"code":"86","parentValue":"RHO","name":"Bio c' Bon Lyon République"},{"code":"89","parentValue":"RHO","name":"Bio c' Bon Dijon"},{"code":"213","parentValue":"RHO","name":"Bio c' Bon Chambéry"},{"code":"219","parentValue":"RHO","name":"Bio c' Bon Lyon Lumière"},{"code":"85","parentValue":"MDP","name":"Bio c' Bon Toulouse Capitole"},{"code":"210","parentValue":"MDP","name":"Bio c' Bon Toulouse Lion"},{"code":"227","parentValue":"MDP","name":"Bio c' Bon Toulouse Matabiau"},{"code":"229","parentValue":"MDP","name":"Bio c' Bon Toulouse Saint Michel"},{"code":"226","parentValue":"MDP","name":"Bio c' Bon Perpignan Victoire"},{"code":"231","parentValue":"MDP","name":"Bio c' Bon Toulouse Vidal"},{"code":"236","parentValue":"GEST","name":"Bio c' Bon Nancy"},{"code":"235","parentValue":"GEST","name":"Bio c' Bon Colmar"},{"code":"239","parentValue":"IDF","name":"Bio c' Bon Puteaux Verdun"},{"code":"501","parentValue":"LAU","name":"Bio c’ Bon Lausanne"},{"code":"502","parentValue":"GEN","name":"Bio c' Bon Genève"},{"code":"503","parentValue":"REN","name":"Bio c’ Bon Renens"},{"code":"504","parentValue":"NYO","name":"Bio c’ Bon Nyon"},{"code":"601","parentValue":"BRU","name":"Bio c' Bon Bruxelles Stéphanie"},{"code":"602","parentValue":"BRU","name":"Bio c' Bon Bruxelles Alsemberg"},{"code":"603","parentValue":"BRU","name":"Bio c’ Bon Bruxelles Bascule"},{"code":"604","parentValue":"BRU","name":"Bio c’ Bon Bruxelles Stockel"},{"code":"241","parentValue":"IDF","name":"Bio c' Bon Colombes"},{"code":"240","parentValue":"IDF","name":"Bio c' Bon Faubourg St Honoré"},{"code":"238","parentValue":"IDF","name":"Bio c' Bon Nogent Baltard"},{"code":"233","parentValue":"IDF","name":"Bio c' Bon Le Vésinet"},{"code":"242","parentValue":"AQUITAINE","name":"Bio c' Bon Pau"},{"code":"243","parentValue":"IDF","name":"Bio c' Bon Assas"}]}];var formbuilder_obj = (function() { // Instance stores a reference to the Singleton var instance; function init(config) { // Singleton, // cookies functions this._insertAfter = function(newNode, referenceNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); }; this._checkEmail = function(email){ var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,25})+$/; //var mailformat = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,15}$/; return email.match(mailformat) }; this._createCookie = function(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; ////console.log('cr?ation du cookies : ' + name + "=" + value + expires + "; path=/"); document.cookie = name + "=" + value + expires + "; path=/"; }; this._readCookie = function(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }; this._eraseCookie = function(name) { this._createCookie(name, "", -1); }; this._feedDynamicLists = function() { // cette m�thode remplira les champs de type liste d�roulante if(this._htmlcontent.length>0){ for (var index = 0; index < this._datas.length; ++index) { _prefillfieldsfromcookies(); switch (this._datas[index].type) { case "simple": var selectbox = document.getElementById(this._datas[index].fieldId); if (selectbox != null) { opt = document.createElement("option"); opt.value = ''; opt.text = ''; opt.label = ''; selectbox.appendChild(opt); var options = this._datas[index].data; for (i = 0; i < options.length; ++i) { var optdata = options[i]; var filteringField = document.getElementById(this._datas[index].formParentFieldId); if((optdata.parentValue !== null && optdata.parentValue !== undefined) && (filteringField !== null && filteringField !== undefined)){ if(filteringField !== null && filteringField !== undefined){ if(optdata.parentValue === filteringField.value){ ////console.log('optdata.parentValue === filteringField.value'); opt = document.createElement("option"); opt.value = optdata.code; opt.text = optdata.name; opt.label = optdata.name; selectbox.appendChild(opt); } } }else{ opt = document.createElement("option"); opt.value = optdata.code; opt.text = optdata.name; opt.label = optdata.name; selectbox.appendChild(opt); } } } break; case "multiple": ////console.log('_feedDynamicLists multiple : ' + this._datas[index].fieldId + 'area'); var multiplediv = document.getElementById(this._datas[index].fieldId + 'area'); if (multiplediv != null) { var options = this._datas[index].data; var multiplehtmlcontent = ''; for (i = 0; i < options.length; ++i) { var optdata = options[i]; var filteringField = document.getElementById(this._datas[index].formParentFieldId); if((optdata.parentValue !== null && optdata.parentValue !== undefined) && (filteringField !== null && filteringField !== undefined)){ if(filteringField !== null && filteringField !== undefined){ if(optdata.parentValue === filteringField.value){ multiplehtmlcontent += '' + optdata.name + '
'; } } }else multiplehtmlcontent += '' + optdata.name + '
'; } multiplediv.innerHTML = multiplehtmlcontent; } break; } } } }; this._feedDynamicList = function(fields,filteringValue){ for (var ind = 0; ind < this._datas.length; ++ind){ var field = fields[ind]; // //console.log('_feedDynamicList : field : ' + field + ' , filteringValue :' + filteringValue); var fieldDatas = {}; for (var index = 0; index < this._datas.length; ++index) { if(this._datas[index].fieldId === field) { fieldDatas = this._datas[index]; break; } } switch (fieldDatas.type) { case "simple": var selectbox = document.getElementById(this._datas[index].fieldId); if (selectbox != null) { //vider le champ var length = selectbox.options.length; for (i = 0; i < length+1; i++) { selectbox.remove(1); } // remplir la liste d�roulante opt = document.createElement("option"); opt.value = ''; opt.text = ''; opt.label = ''; //selectbox.appendChild(opt); var options = fieldDatas.data; for (i = 0; i < options.length; ++i) { var optdata = options[i]; if(filteringValue !== null){ if(optdata.parentValue === filteringValue){ opt = document.createElement("option"); opt.value = optdata.code; opt.text = optdata.name; opt.label = optdata.name; selectbox.appendChild(opt); } }else{ opt = document.createElement("option"); opt.value = optdata.code; opt.text = optdata.name; opt.label = optdata.name; selectbox.appendChild(opt); } } } break; case "multiple": // //console.log('_feedDynamicList multiple : ' + this._datas[index].fieldId + 'area'); var multiplediv = document.getElementById(this._datas[index].fieldId + 'area'); if (multiplediv != null) { var options = this._datas[index].data; var multiplehtmlcontent = ''; for (i = 0; i < options.length; ++i) { var optdata = options[i]; if(filteringValue !== null){ if(optdata.parentValue === filteringValue){ multiplehtmlcontent += '' + optdata.name + '
'; } }else multiplehtmlcontent += '' + optdata.name + '
'; } multiplediv.innerHTML = multiplehtmlcontent; } break; } } }; this._inject = function(src, type) { // fonction qui permet d'injecter un css ou un javascript dynamiquement dans la page type = type || 'js'; if (type == 'js') { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src; } else if (type == 'css') { var s = document.createElement('link'); s.type = 'text/css'; s.rel = 'stylesheet'; s.href = src; } (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s); }; this._serializeform = function(form, format) { switch (format) { case 'uri': if (!form || form.nodeName !== "FORM") { return; } var i, j, q = []; for (i = form.elements.length - 1; i >= 0; i = i - 1) { if (form.elements[i].name === "") { continue; } switch (form.elements[i].nodeName) { case 'INPUT': switch (form.elements[i].type) { case 'text': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'textarea': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'hidden': case 'password': case 'button': case 'reset': case 'date': q.push(form.elements[i].name + "=" + form.elements[i].value); break; case 'number': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'submit': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'checkbox': case 'radio': if (form.elements[i].checked) { q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); } else q.push(form.elements[i].name + "="); break; case 'file': break; } break; case 'TEXTAREA': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'SELECT': switch (form.elements[i].type) { case 'select-one': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; case 'select-multiple': for (j = form.elements[i].options.length - 1; j >= 0; j = j - 1) { if (form.elements[i].options[j].selected) { q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[j].value)); } } break; } break; case 'BUTTON': switch (form.elements[i].type) { case 'reset': case 'submit': case 'button': q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value)); break; } break; } } return q.join("&"); break; case 'rest': if (!form || form.nodeName !== "FORM") { return; } //var i, j, q = []; var i, j = []; var q = {}; for (i = form.elements.length - 1; i >= 0; i = i - 1) { if (form.elements[i].name === "") { continue; } switch (form.elements[i].nodeName) { case 'INPUT': switch (form.elements[i].type) { case 'text': q[form.elements[i].name] = form.elements[i].value; break; case 'textarea': q[form.elements[i].name] = form.elements[i].value; break; case 'hidden': break; case 'password': break; case 'button': break; case 'reset': break; case 'date': q[form.elements[i].name] = form.elements[i].value; break; case 'number': q[form.elements[i].name] = form.elements[i].value; break; case 'submit': q[form.elements[i].name] = form.elements[i].value; break; case 'checkbox': break; case 'radio': if (form.elements[i].checked) { q[form.elements[i].name] = form.elements[i].value; } else { q[form.elements[i].name] = ""; } break; case 'file': break; } break; case 'TEXTAREA': q[form.elements[i].name] = form.elements[i].value; break; case 'SELECT': switch (form.elements[i].type) { case 'select-one': q[form.elements[i].name] = form.elements[i].value; break; case 'select-multiple': var selected = []; for (j = form.elements[i].options.length - 1; j >= 0; j = j - 1) { if (form.elements[i].options[j].selected) { selected.push(form.elements[i].options[j].value); } } q[form.elements[i].name] = selected; break; } break; case 'BUTTON': switch (form.elements[i].type) { case 'reset': break; case 'submit': break; case 'button': q[form.elements[i].name] = form.elements[i].value; break; } break; } } return q; break; } }; this._valideasiform = function() { // Ajouter des test pour les champs obligatoire var elements = document.forms['easiform'].elements; var errorfields = ''; var errorfieldsarray = []; var errorfieldsnamearray = []; var validationError = false; var errorMessage = ""; // Traitement des liens multiple avec des checbox : var inputgroups = jQuery('#easiform .multiplechoicearea'); for (i = 0; i < inputgroups.length; i++) { var inputgroup = inputgroups[i]; if (inputgroup.getAttribute('mandatory') == 'true') { // checboxes obligatoires var empty = true; var checkboxes = inputgroup.getElementsByTagName('input'); for (j = 0; j < checkboxes.length; j++) { var element = checkboxes[j]; var value = element.checked; if (element.checked) { empty = false; break; } } if (empty) { errorfieldsarray.push(element); errorfieldsnamearray.push(inputgroup.getAttribute('label')); validationError = true } } } //Champs obligatoires for (i = 0; i < elements.length; i++) { var element = elements[i]; var value = element.value; if ((element.value == null || element.value == '') && element.getAttribute('mandatory') == 'true') { errorfieldsarray.push(element); errorfieldsnamearray.push(element.getAttribute('label')); validationError = true } } //construction du message d'erreur : errorMessage = this._mandatoryFieldEmptyMessage.replace("%P1", errorfieldsnamearray.join()); // Test du champs email : //D?tection du champs email if(!validationError){ var emailfield = document.getElementById("fld_Email"); if(emailfield !== null && emailfield !== undefined ) { if(emailfield.value !== null && emailfield.value !== undefined && emailfield.value.length>0 ){ var checkEmailFormat = this._checkEmail(emailfield.value) if(!checkEmailFormat) { validationError = true; errorMessage = this._MailErrorMessage; } } } } //ajouter un test li� au recaptcha if(this._recaptchaResponseOK){ errorMessage = "captcha OFF"; validationError = true; } if (validationError) { alert(errorMessage); valid = false; return valid; } else {// si pas d'ereur on submit jQuery('#validatebutton').addClass('disabled-validatebutton'); jQuery("#easiformWaiting").show(); //Param�tres syst�me var systemParams = {}; systemParams["fld_formid"] = this._formid; systemParams["fld_lang"] = this._language; systemParams["recaptcha_token"] = _recaptchaResponseToken; ////console.log("System Params : ");console.dir(systemParams); //donn�es du formulaire (type "simple") var formSimpleData = this._serializeform(document.forms['easiform'], 'rest'); var filesNames = {}; var filesData = {}; //Appel ? la fonction JS en REST jQuery.support.cors = true; //n?cessaire pour IE10 et IE11 jQuery.ajax({ url: this._formurl, type:"POST", data: JSON.stringify({ "fct_name": "jsCreateWebRequest", "authentication" : { "userid" : this._restUserId, "password" : this._restPwd }, "params": { "odSystemParams": systemParams, "odSimpleData" : formSimpleData, "odInputFiles" : _fileFields } }), contentType:"application/json", dataType:"json", crossDomain : true, success: function(resultSuccess) { if (resultSuccess) { if(resultSuccess.status == "OK") { //console.log("Call OK !"); //console.dir(resultSuccess); var data = JSON.parse(resultSuccess.data); if (data.result == 'success') { jQuery("#easiformWaiting").hide(); //Affichage message de remerciement if (_thankmessage !== null && _thankmessage.length > 0) alert(_thankmessage); //Si redirection d�finie, redirection vers URL donn�e if (data.redirection_url != null && data.redirection_url.length > 0) { // window.open(data.redirecution_url,'_self'); if(config.redirectionMode=="_blank"){ window.open(data.redirection_url,config.redirectionMode); } else { window.location.href = data.redirection_url; } } else { //Sinon, affichage message de remerciement en lieu et place du formulaire if (data.thankmessage != null && data.thankmessage.length > 0) { jQuery('#easiformarea').html(data.thankmessage); } } } else { //Erreur easiware => consultant ou autre jQuery("#easiformWaiting").hide(); alert(data.message); if(_recaptchaEnabled) if (typeof $('#easi_recaptcha_div') != "undefined") { grecaptcha.reset(); } } } else { jQuery("#easiformWaiting").hide(); //console.log("Call OK with status = KO : " + resultSuccess.error); } } else { jQuery("#easiformWaiting").hide(); } }, error: function (resultError) { jQuery("#easiformWaiting").hide(); if(_recaptchaEnabled) if (typeof $('#easi_recaptcha_div') != "undefined") { grecaptcha.reset(); } ////console.log("Call KO !") //console.dir(resultError); } }); return true; } }; this._createform = function() { var formtosend =''; if(this._htmlcontent.length>0){ formtosend = '
'; formtosend += this._htmlcontent; formtosend += ""; formtosend += "
"; formtosend += "
" + this._mandatoryFieldsMention + "
"; formtosend += "
" + this._additionnalInformation + "
"; var validatebuttondisabledoption = ""; if(_recaptchaEnabled){ ////console.log('afficher la div du recaptcha'); formtosend += "
"; validatebuttondisabledoption = "disabled-validatebutton"; } if (_context != 'preview') formtosend += ""; if(this._waitingMsg.length > 0) { if(document.getElementById('easiformWaitingMsg') !== null) document.getElementById('easiformWaitingMsg').innerHTML = this._waitingMsg; } }else{ formtosend = '
' + this._formEmptyExpression + '
'; } document.getElementById('easiformarea').innerHTML = formtosend; var subCategoryfield = document.getElementById("fld_SubCategory");// pour g?rer le cas des //Int�grer le bloc pour la KB if(this._integrateKB && subCategoryfield !== null && subCategoryfield !== undefined ) { var subCategoryDiv = document.getElementById("fld_SubCategory").parentNode.parentNode; var el = document.createElement("div"); el.id = "easiformKBzone"; el.innerHTML = this._KBnoarticles; el.class = "easiformKBZone"; this._insertAfter(el, subCategoryDiv); } }; this._prefillfieldsfromcookies = function() { if(this._htmlcontent.length>0){ var cookieForm = this._readCookie("easiform"); if(this._fieldPrefilling){ if (cookieForm != null) { var fieldval = cookieForm.split('&'); for (i = 0; i < fieldval.length; i++) { var fieldvalelt = fieldval[i]; var sublements = fieldvalelt.split("="); var element = document.easiform[sublements[0]]; var value = decodeURIComponent(sublements[1]).replace("%40", "@").replace("%2F", "/"); if (element != null) { if (element.length > 0) { if(element.type == 'select-one') { element.value = value; if(element.id === 'fld_SubCategory' && this._integrateKB){ var params = {}; params.category = value; setTimeout(function(){_searchKB(params);},0); } } else{ for (j = 0; j < element.length; j++) { var elt = element[j]; if (elt.value === value) elt.checked = true; } } } else if (element != null) { switch (element.type) { case 'text': element.value = value; break; case 'checkbox': element.checked = true; break; case 'select-one': element.value = value; } } } } } } } }; this._bindfields = function() { if(this._htmlcontent.length>0){ var elements = document.forms['easiform'].elements; var _integrateKB = this._integrateKB var _searchKB = this._searchKB for (i = 0; i < elements.length; i++) { var element = elements[i]; if(element.type !== 'file'){ if (element.addEventListener) { element.addEventListener("change", function() { _createCookie("easiform", _serializeform(document.forms['easiform'], 'uri'), 100); // //console.log("attachEvent this.id this.id : " + this.id) if(_integrateKB && this.id === 'fld_SubCategory') { var params = {}; params.category = this.value; _searchKB(params); } }, false); } else { element.attachEvent("onchange", function() { _createCookie("easiform", _serializeform(document.forms['easiform'], 'uri'), 100); // //console.log("attachEvent this.id : " + this.id) if(_integrateKB && this.id === 'fld_SubCategory'){ var params = {} params.category = this.value; _searchKB(params); } }, false); } } } //Binding des champs de type file afin de r?cup?rer leur contenu //r�cup�rer le contenu des champs files _filesFieldsIdsArray = document.querySelectorAll("#easiform [type=file]"); var fileFieldsArray = []; var loadFiles = function(event) { var fileIndex = 0; var input = event.target; var files = input.files; var reader = new FileReader(); function readFile(index) { if(index >= files.length) return; var file = files[index]; reader.onload = function(e) { var arrayBuffer = reader.result; //var arrayBufferComma = arrayBuffer.indexOf(","); if(_fileFields[input.id].files === null || _fileFields[input.id].files === undefined) _fileFields[input.id].files = []; _fileFields[input.id].files[fileIndex] = {}; _fileFields[input.id].files[fileIndex].name = input.files[fileIndex].name; //_fileFields[input.id].files[fileIndex].buffer = arrayBuffer.substring(arrayBufferComma + 1, arrayBuffer.length); _fileFields[input.id].files[fileIndex].fileText = arrayBuffer; //console.log("Reading file '" + input.files[fileIndex].name + "' OK"); fileIndex++; readFile(fileIndex) } //reader.readAsDataURL(file); //reader.readAsArrayBuffer(file); reader.readAsText(file, 'ISO-8859-1'); }; readFile(0); reader.onerror = function() { //console.log("Error reading file '" + input.files[fileIndex].name + "'"); }; }; //Add Event Listener for Input Files for (var index = 0; index < _filesFieldsIdsArray.length; ++index) { var fileField = _filesFieldsIdsArray[index]; _fileFields[fileField.id] = {}; if (fileField.addEventListener) { ////console.log('File binding fileField addEventListener: ' + fileField.id); fileField.addEventListener("change", function(evt) { loadFiles(evt); }, false); } else { ////console.log('File binding fileField addEventListener: ' + fileField.id); fileField.attachEvent("onchange", function(evt) { loadFiles(evt); }, false); } } //Add Event Listener For Submit document.getElementById("validatebutton").addEventListener("click", function(event){ if(_recaptchaEnabled){ if ($(this).hasClass('disabled-validatebutton')) { alert(_recaptchaErrorMessage); } else { myformbuilder.valideasiform(); } } else{ myformbuilder.valideasiform(); } }); } }; this._bindFilteringField = function(){// Fire an action when a field change and must refresh another field values // //console.log('_bindFilteringField this._htmlcontent.length : ' + this._htmlcontent.length); if(this._htmlcontent.length>0){ var fieldIds = []; var parentFields ={}; var parentFieldsList = []; // Binding des listes d�roulantes pour le filtrage du contenu, for (var index = 0; index < this._datas.length; ++index) { var parentField = this._datas[index].formParentFieldId; if(parentField !== null && parentField !== undefined){ if(parentFields[parentField] !== null && parentFields[parentField] !== undefined){ parentFields[parentField].fields.push(this._datas[index].fieldId); }else { parentFieldsList.push(parentField); parentFields[parentField]= {}; parentFields[parentField].fields = []; parentFields[parentField].fields.push(this._datas[index].fieldId); } } } for (var i = 0; i < parentFieldsList.length; i++) { var parentField = document.getElementById(parentFieldsList[i]); if(parentField !== null && parentField !== undefined){ parentField.fieldIds = parentFields[parentFieldsList[i]].fields; if (parentField.addEventListener) { var listener = parentField.addEventListener("change", function(evt) { _feedDynamicList(evt.target.fieldIds,evt.target.value); }, false); } else { parentField.attachEvent("onchange", function(evt) { _feedDynamicList(evt.target.fieldIds,evt.target.value); }, false); } } } } }; this._searchKB = function(params){ var category = params.category; params.formId = this._formid params.language =this._language var _KBZoneTitle = this._KBZoneTitle var _KBnoarticles = this._KBnoarticles jQuery.support.cors = true; //n?cessaire pour IE10 et IE11 jQuery.ajax({ url: this._formurl, type:"POST", data: JSON.stringify({ "fct_name": "jsFormKBByCategory", "authentication" : { "userid" : this._restUserId, "password" : this._restPwd }, "params": { "params":params } }), contentType:"application/json", dataType:"json", crossDomain : true, success: function(resultSuccess) { if (resultSuccess) { if(resultSuccess.status == "OK") { var data = resultSuccess.data; var articles = data.data; var result = data.result; if(result === 'success'){ var html = ""; if(articles.length>0) { html = "
" + _KBZoneTitle + "
" articles.forEach(function(e){ html += "
" + e.title + "
" }) }else{ html = "
" + _KBnoarticles + "
" } jQuery("#easiformKBzone").html(html); }else { console.log("erreur lors de la r?cup?ration des message :" + data.data); } } else { console.log("Call OK with status = KO : " + resultSuccess.error); } } }, error: function (resultError) { jQuery("#easiformWaiting").hide(); //console.log("Call KO !") //console.dir(resultError); } }); }; this._bindKBFields = function(){//fire the action to search the right element in the KB jQuery("#fld_Category").change(function() { //Console.log( "Handler for .change() called. for category" ); }); jQuery("#fld_Description").change(function() { //Console.log( "Handler for .change() called. for Description" ); }); } //JSON FORM - OBSOLETE this._createjsonForm = function() { var jsonformschema = JSON.parse(this._jsonformschema); jQuery.getScript("//cdn.jsdelivr.net/underscorejs/1.6.0/underscore-min.js", function() { jQuery.getScript(_solutionUrl + "_CRM/FrmBldr/jsonform.js", function() { jQuery('#easiformarea').jsonForm({ params: { fieldHtmlClass: "form-control" }, schema: _jsonformschema, onSubmit: function(errors, values) { if (errors) { alert('bad!:(') } else { alert('good!'); } } }); }); }); }; this._solutionUrl = config.siteUrl; this._datas = config.data; this._formid = config.formId; this._htmlcontent = config.htmlcontent; this._formurl = config.formurl; this._thankmessage = config.thankmessage; this._jsonformschema = config.jsonformschema; this._context = config.context; this._language = config.language; this._validatebuttonlabel = config.validatebuttonlabel; this._fieldPrefilling = config.fieldPrefilling; this._mandatoryFieldsMention = config.mandatoryFieldsMention; this._formEmptyExpression = config.formEmptyExpression; this._restUserId = config.restUserId; this._restPwd = config.restPwd; this._waitingMsg = config.waitingMsg; this._mandatoryFieldEmptyMessage = config.mandatoryFieldEmptyMessage; this._additionnalInformation = config.additionnalInformation; this._redirectionMode = config.redirectionMode; this._integrateKB = config.integrateKB; this._KBnoarticles = config.KBNoarticles; this._KBZoneTitle = config.KBZoneTitle; this._MailErrorMessage = config.MailErrorMessage; //recaptchas var _recaptchaEnabled = config.recaptchaEnabled; this._recaptchaK = config.recaptchaK; var _recaptchaResponseOK = false; var _recaptchaResponseToken = ""; var _recaptchaErrorMessage = config.recaptchaErrorMessage; //gestion des fichiers init new variables this._fileFields = {}; this._filesFieldsIdsArray = []; return { // Public methods and variables recaptchaVerifyCallback : function(response) { _recaptchaResponseOK = true; _recaptchaResponseToken = response; jQuery('#validatebutton').removeClass('disabled-validatebutton'); }, go: function() { if (!window.jQuery) { //console.log('inject jquery'); _inject("https://code.jquery.com/jquery-1.11.0.min.js", "js"); }; if(this._integrateKB){ setTimeout(function(){ _createform(); _feedDynamicLists(); _bindfields(); _bindFilteringField(); _prefillfieldsfromcookies(); },200) }else { _createform(); _feedDynamicLists(); _bindfields(); _bindFilteringField(); _prefillfieldsfromcookies(); } }, valideasiform: function() { _valideasiform(); } }; }; return { // Get the Singleton instance if one exists // or create one if it doesn't getInstance: function(config) { if (!instance) { instance = init(config); } return instance; } }; })(); var myformbuilder = formbuilder_obj.getInstance({ "siteUrl": "https://www3.easiware.fr/biocbon/", "formId": "1", "data": dynamicListContent, "htmlcontent": "