// Permet ee pas entrer en conflict avec d'autre framework var $j = jQuery.noConflict(); $j(document).ready(function(){ if($j().slides){ $j("#homeBloc10").slides({ /*pagination: false, */ generatePagination: false, effect: 'fade', play: 5000, pause: 2000 }); } /** * BASE DU CMS */ if($j().datepicker) { $j(".datePicker").datepicker({ dateFormat: 'dd.mm.yy', showOn: "button", buttonImageOnly: true }); } if($j().Tree) { $j('#tree').Tree(); } if($j().metadata) { $j.metadata.setType("attr", "validate"); } /* select custom*/ $j(function(){ $j('select.styled').customStyle(); }); /**/ $j('#blocSousMenu li li:has(ul)').children('a').click(function(e) { e.preventDefault(); firstLevel = $j(this).parent('li'); if (firstLevel.hasClass('navClose')){ firstLevel.removeClass('navClose'); firstLevel.addClass('navOpen'); }else{ firstLevel.removeClass('navOpen'); firstLevel.addClass('navClose'); } $j(this).next().slideToggle('fast'); //Refermer les autres div $j('ul',$j(this).parent().siblings()).slideUp(); }); /**************************** // select homepage formation ****************************/ $j("#selectFormation").change(function () { var str = ""; $("#selectFormation option:selected").each(function () { str += $(this).val(); }); document.location.href=str; }) /**************************** // select homepage cours a la carte ****************************/ $j("#selectCoursCarte").change(function () { var str = ""; $("#selectCoursCarte option:selected").each(function () { str += $(this).val(); }); document.location.href=str; }) /**************************** // select homepage orientaiton et conseil ****************************/ $j("#selectOrientationConseil").change(function () { var str = ""; $("#selectOrientationConseil option:selected").each(function () { str += $(this).val(); }); document.location.href=str; }) /* ouvre popup Newsletter*/ if($j().dialog) { $j("#ouvrePopupNewsletter,.classPasBrochure,.classPasBrochureSsMenu").click(function (e) { id_formation=""; prochaineSession="0"; if($j("#id_formations").val()!=0 && $j(this).hasClass("classPasBrochureSsMenu")==false){ id_formation= $j("#id_formations").val(); } else{ id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; id_formation = id.substr(pos,id.length-pos); } if(id_formation== 24 || id_formation==25 || id_formation== 26 || $j("#id_domaine").html()==2){ hauteur="400"; titre=""; } else{ hauteur="300"; titre=$j("#titrePopupNewsletter").html(); } if($j(this).attr("id")=="ouvrePopupNewsletter") { prochaineSession= "&prochaineSession=1"; titre=$j("#titrePopupNewsletter").html(); hauteur="300"; } $j.ajax({ type: "POST", url: "./include/ajax/affichePopupNewsletter.php", data: "id_formations="+id_formation+"&id_domaine="+$j("#id_domaine").html()+"&id_cours_a_la_carte="+$j("#id_cours_a_la_carte").val()+prochaineSession, async:false, success: function(msg){ $j('#popupNewsletter').html(msg); $j('#popupNewsletter').dialog({ width: 450, height:hauteur, title: titre, modal: true, closeText: "", buttons : [] }); if($j("#newsletterForm").attr("action") != null){ $j.validator.messages.required = ""; $j("#newsletterForm").validate({ invalidHandler: function(e, validator) { $j("label.error").css("display","none"); alert("Veuillez vérifier les informations saisies"); }, submitHandler: function(form) { $j.ajax({ type: "POST", url: "./include/ajax/affichePopupNewsletter.php?confirmation=1", data: "postForm="+$j("#postForm").val()+"&choixCoursFormation="+$j("#choixCoursFormation").val()+"&choixCoursALaCarte="+$j("#choixCoursALaCarte").val()+"&choixLieu="+$j("#choixLieu").val()+"&titre="+$j("#titre").val()+"&nom="+$j("#nom").val()+"&prenom="+$j("#prenom").val()+"&email="+$j("#email").val()+"&jeton="+$j("#jeton").val()+"&prochaineSession="+$j("#prochaineSession").val(), async:false, success: function(msg){ // indique à Google Ananlytics le passage sur la page confirmation _gaq.push(['_trackPageview', '/include/ajax/affichePopupNewsletter.php?confirmation=1']); $j('#popupNewsletter').html(msg); $j('#popupNewsletter').dialog({ width: 450, height:300, modal: true, closeText: "", buttons: { Fermer: function() { $j( this ).dialog( "close" ); } } }); } }); } }); } } }); }); $j("#ouvrePopupTemoignage").click(function (e) { $j.ajax({ type: "POST", url: "./include/ajax/affichePopupTemoignage.php", data: "idDomaineActif="+$j("#idDomaineActif").val()+"&id_formations="+$j("#id_formations").val()+"&type=2&orientaitonEtConseil="+$j("#orientaitonEtConseil").val()+"&idTemoignage="+$j("#idTemoignage").val(), async:false, success: function(msg){ $j('#popup').html(msg); $j('#popup').dialog({ width: 700, height:500, modal: true, closeText: "", buttons: { Fermer: function() { $j( this ).dialog( "close" ); } } }); } }); }); $j(".affichePopupContenu").click(function (e) { $j('#popupContenu').dialog({ width: 750, height:550, modal: true, closeText: "", buttons: { Fermer: function() { $j( this ).dialog( "close" ); } } }); }); /* Popup Condition générales inscription */ $j("#condtionGeneralInscription").click(function (e) { $j('#popupCondtionGeneralInscription').dialog({ width: 700, height:500, modal: true, closeText: "", buttons: { Fermer: function() { $j( this ).dialog( "close" ); } } }); }); } /* Documentations */ // $j(".deleteFormation").click(function (e) { id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; idFormation = id.substr(pos,id.length-pos); $j("#idFormation_"+idFormation).val("0"); $j(this).parent().css("display","none"); }); $j(".addBrochureBtn").click(function (e) { e.preventDefault(); var allFormation = ""; var allFormationSel = ""; if ($j('#demandeDocForm').length == 0){ allFormation = $j("#idFormationPreSelection").val(); }else{ $j('#documentations').find('input[id^=\'idFormation_\']').each(function() { if ($j(this).val() == 1){ id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; idFormation = id.substr(pos,id.length-pos); allFormation = allFormation + "-"+idFormation; } }); } $j.ajax({ type: "POST", url: "./include/ajax/affBrochure.php", data: "formationActive="+allFormation, async:false, success: function(msg){ $j('#dialogBrochure').html(msg); $j('#dialogBrochure').dialog({ width: 850, height:700, modal: true, closeText: "", buttons: { Valider: function() { $j('#documentations').find('input[id^=\'idFormation_\']').each(function() { id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; idFormation = id.substr(pos,id.length-pos); $j(this).val("0"); $j(this).parent().css("display","none"); }); $j('#dialogBrochure').find('input[id^=\'idFormationSelection_\']').each(function() { if ($j(this).val() == 1){ id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; idFormation = id.substr(pos,id.length-pos); $j("#idFormation_"+idFormation).val("1"); $j("#idFormation_"+idFormation).parent().css("display","block"); allFormationSel = allFormationSel + "-"+idFormation; } }); if ($j('#demandeDocForm').length == 0){ window.location=$j("#pageDocumentation").val()+"?formationActive="+allFormationSel; } $j(this).dialog( "close" ); } } }); } }); }); $j('.brochureAdd').live('click', function() { var id = $j(this).attr("id"); pos = id.lastIndexOf("_")+1; idFormation = id.substr(pos,id.length-pos); if ($j("#idFormationSelection_"+idFormation).val() == "0"){ $j("#idFormationSelection_"+idFormation).val("1"); $j("#btnBrochure_"+idFormation).attr("src","./images/vu.png"); $j("#nomBrochureSelection_"+idFormation).addClass("actif"); }else{ $j("#idFormationSelection_"+idFormation).val("0"); $j("#btnBrochure_"+idFormation).attr("src","./images/plus_out.png"); $j("#nomBrochureSelection_"+idFormation).removeClass("actif"); } }); /* demande de formulaire affiche ou pas les infos de l'adresse */ $j("#envoiPapier").click(function (e) { if($j('#blocAdresse').css("display")=="none"){ $j('#blocAdresse').css("display","block"); }else{ $j('#blocAdresse').css("display","none"); } }); // Expand div deroulante pour les listing des témoignages if( $j().divgrow ) { $j('div.slideWrapper').divgrow({ initialHeight: 0, moreText: "Détails",/**/ lessText: "Fermer", /**/ showBrackets: false, speed: 500 }); }; /****************************************************/ /* Produits BO */ /****************************************************/ if($j().tabs) { $j("#tabs").tabs(); } /****************************************************/ /* Navigation site */ /****************************************************/ $j("#navPrinc ul").css({display: "none"}); // Opera Fix $j("#navPrinc li").hover(function(){ $j(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200); },function(){ $j(this).find('ul:first').css({visibility: "hidden"}); /*$j('#moduleSite tbody tr:last').css("display","");*/ }); /****************************************************/ /* Dans la gestion des planning*/ /****************************************************/ $j("#addVarianteDetail").click(function (e) { $j('#tableVarianteDetail tbody tr:last').clone(true).insertAfter('#tableVarianteDetail tbody tr:last'); $j('#tableVarianteDetail tbody tr:last').find('input[name=\'idChamps[]\']').each(function() { $j(this).val(""); }); }); $j("a.deleteVarianteDetail").click(function (e) { e.preventDefault(); nbLigne = $j('#tableVarianteDetail tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /****************************************************/ /* Dans la gestion des news*/ /****************************************************/ $j("#addNewsZonePublicationMenu").click(function (e) { $j('#tableNewsZonePublicationMenu tbody tr:last').clone(true).insertAfter('#tableNewsZonePublicationMenu tbody tr:last'); $j('#tableNewsZonePublicationMenu tbody tr:last').find('input[name=\'idChampsMenu[]\']').each(function() { $j(this).val(""); }); }); $j("a.deleteNewsZonePublicationMenu").click(function (e) { e.preventDefault(); nbLigne = $j('#tableNewsZonePublicationMenu tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); $j("#addNewsZonePublicationPage").click(function (e) { $j('#tableNewsZonePublicationPage tbody tr:last').clone(true).insertAfter('#tableNewsZonePublicationPage tbody tr:last'); $j('#tableNewsZonePublicationPage tbody tr:last').find('input[name=\'idChampsPage[]\']').each(function() { $j(this).val(""); }); }); $j("a.deleteNewsZonePublicationPage").click(function (e) { e.preventDefault(); nbLigne = $j('#tableNewsZonePublicationPage tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /**********************************************************************************************************************************************************************/ /* INSCRIPTION */ /**********************************************************************************************************************************************************************/ /****************************************************/ /* Dans l'inscription ajout de cours*/ /****************************************************/ // Pour les formations $j("#addCoursFormation").click(function (e) { $j('#tableCoursFormation tbody tr:last').clone(true).insertAfter('#tableCoursFormation tbody tr:last'); lastRow = $j('[id^=choixCoursFormation_]').filter(':last').attr('id'); lastUnderscore = lastRow.lastIndexOf("_")+1; identifiantRow = lastRow.substr(lastUnderscore,lastRow.length)*1; identifiantRowNext = identifiantRow + 1; $j('[id^=choixCoursFormation_]').filter(':last').attr('id','choixCoursFormation_'+identifiantRowNext); $j('[id^=divChoixLieuFormation_]').filter(':last').attr('id','divChoixLieuFormation_'+identifiantRowNext); $j('[id^=divChoixDateFormation_]').filter(':last').attr('id','divChoixDateFormation_'+identifiantRowNext); $j('#choixCoursFormation_'+identifiantRowNext+' option[value=""]').attr("selected", "selected"); $j('#divChoixLieuFormation_'+identifiantRowNext).html(""); $j('#divChoixDateFormation_'+identifiantRowNext).html(""); }); $j("a.deleteCoursFormation").click(function (e) { e.preventDefault(); nbLigne = $j('#tableCoursFormation tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); // Pour les cours à la carte $j("#addCoursCoursALaCarte").click(function (e) { $j('#tableCoursCoursALaCarte tbody tr:last').clone(true).insertAfter('#tableCoursCoursALaCarte tbody tr:last'); lastRow = $j('[id^=choixCoursCoursALaCarte_]').filter(':last').attr('id'); lastUnderscore = lastRow.lastIndexOf("_")+1; identifiantRow = lastRow.substr(lastUnderscore,lastRow.length)*1; identifiantRowNext = identifiantRow + 1; $j('[id^=choixCoursCoursALaCarte_]').filter(':last').attr('id','choixCoursCoursALaCarte_'+identifiantRowNext); $j('[id^=divChoixLieuCoursALaCarte_]').filter(':last').attr('id','divChoixLieuCoursALaCarte_'+identifiantRowNext); $j('[id^=divChoixDateCoursALaCarte_]').filter(':last').attr('id','divChoixDateCoursALaCarte_'+identifiantRowNext); $j('#choixCoursCoursALaCarte_'+identifiantRowNext+' option[value=""]').attr("selected", "selected"); $j('#divChoixLieuCoursALaCarte_'+identifiantRowNext).html(""); $j('#divChoixDateCoursALaCarte_'+identifiantRowNext).html(""); }); $j("a.deleteCoursCoursALaCarte").click(function (e) { e.preventDefault(); nbLigne = $j('#tableCoursCoursALaCarte tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /***************************************************/ /* Dans l'inscription ajout de lieu et de date en rapport avec un cours choisi */ /* Dans l'inscription cours à la carte ajout de lieu et de date en rapport avec un cours choisi */ /***************************************************/ // pour les formations $j('.choixCoursFormation').change(function(e) { choixCoursFormation ($j(this).attr("id")) ; }); if( $j('#choixCoursFormation_1').val()!=""){ choixCoursFormation('choixCoursFormation_1'); } $j('.choixLieuFormation').live('change', function(e){ if ($j(this).val()!=""){ idObjet= $j(this).attr("id"); idLigne= idObjet.substr(19,idObjet.length); $j('.libelleDateFormation').html("Date"); $j('.libellePrixFormation').html("Prix"); $j.ajax({ type: "POST", url: "./include/ajax/affParamInscription.php", data: "typePage=1&idLigne="+idLigne+"&idFormation="+$j("#choixCoursFormation_"+idLigne).val()+"&idLieu="+$j(this).val(), async:false, success: function(msg){ $j('#divChoixDateFormation_'+idLigne).html(msg); } }); } }); // pour les cours à la carte $j('.choixCoursCoursALaCarte').change(function(e) { choixCoursCoursALaCarte ($j(this).attr("id")) ; }); if( $j('#choixCoursCoursALaCarte_1').val()!=""){ choixCoursCoursALaCarte('choixCoursCoursALaCarte_1'); } $j('.choixLieuCoursALaCarte').live('change', function(e){ if ($j(this).val()!=""){ idObjet= $j(this).attr("id"); idLigne= idObjet.substr(23,idObjet.length); $j('.libelleDateCoursALaCarte').html("Date"); $j('.libellePrixCoursALaCarte').html("Prix"); $j.ajax({ type: "POST", url: "./include/ajax/affParamInscription.php", data: "typePage=2&idLigne="+idLigne+"&idFormation="+$j("#choixCoursCoursALaCarte_"+idLigne).val()+"&idLieu="+$j(this).val(), async:false, success: function(msg){ $j('#divChoixDateCoursALaCarte_'+idLigne).html(msg); } }); } }); /****************************************************/ /* Dans l'inscription parcours professionnel*/ /****************************************************/ $j("#addParcourProf").click(function (e) { $j('#tableParcourProf tbody tr:last').clone(true).insertAfter('#tableParcourProf tbody tr:last'); }); $j("a.deleteParcourProf").click(function (e) { e.preventDefault(); nbLigne = $j('#tableParcourProf tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /****************************************************/ /* Dans l'inscription formation professionnel*/ /****************************************************/ $j("#addFormationProf").click(function (e) { $j('#tableFormationProf tbody tr:last').clone(true).insertAfter('#tableFormationProf tbody tr:last'); }); $j("a.deleteFormationProf").click(function (e) { e.preventDefault(); nbLigne = $j('#tableFormationProf tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /****************************************************************/ /* Dans l'inscription affiche ou pas les infos de mensualité */ /****************************************************************/ $j(".blocMensualiteDetail").click(function (e) { if ($j(this).val() == 3) { $j('#blocMensualite').css("display","block"); }else { $j('#blocMensualite').css("display","none"); } }); /******************/ /****************************************************************/ /* Dans l'inscription affiche ou pas les infos de l'adress différente */ /****************************************************************/ $j("#adresseFacturationDiff").click(function (e) { if($j('#blocAdresseFacturation').css("display")=="none"){ $j('#blocAdresseFacturation').css("display","block"); }else{ $j('#blocAdresseFacturation').css("display","none"); } }); /******************/ $j('#id_domaine').change(function() { var valSel = $j(this).val(); $j('#leftZone').find("div[id^=ordreDomaine_]").each(function() { if($j(this).attr("id") == "ordreDomaine_"+valSel){ $j(this).css("display","block"); }else{ $j(this).css("display","none"); } }); }); /**************************************************/ /* POST du formulaire de Inscription*/ /*************************************************/ if($j().validate) { if($j("#inscriptionForm").attr("action") != null){ $j.validator.messages.required = ""; $j("#inscriptionForm").validate({ rules: { nomFacturation: { required: "#adresseFacturationDiff:checked" }, prenomFacturation: { required: "#adresseFacturationDiff:checked" }, adresseFacturation: { required: "#adresseFacturationDiff:checked" }, npaFacturation: { required: "#adresseFacturationDiff:checked" }, villeFacturation: { required: "#adresseFacturationDiff:checked" } }, invalidHandler: function(e, validator) { $j("label.error").css("display","none"); alert("Veuillez vérifier les informations saisies"); }, submitHandler: function(form) { $j("label.error").css("display","none"); form.submit(); } }); } } /***************************************************/ /* affichage champe autre comment*/ /***************************************************/ $j('#comment').change(function(e) { if ($j(this).val()=="autre"){ $j("#commentAutre").css("display","block"); } else { $j("#commentAutre").css("display","none"); } }); /**********************************************************************************************************************************************************************/ /* DOCUMENTATION */ /**********************************************************************************************************************************************************************/ /**************************************************/ /* POST du formulaire de demande de documentation*/ /*************************************************/ if($j("#demandeDocForm").attr("action") != null){ $j.validator.messages.required = ""; $j("#demandeDocForm").validate({ rules: { adresse: { required: "#envoiPapier:checked" }, npa: { required: "#envoiPapier:checked" }, ville: { required: "#envoiPapier:checked" } }, invalidHandler: function(e, validator) { $j("label.error").css("display","none"); }, submitHandler: function(form) { $j("label.error").css("display","none"); form.submit(); } }); } /**********************************************************************************************************************************************************************/ /* SEMINAIRE */ /**********************************************************************************************************************************************************************/ /****************************************************/ /* Dans la gestion des seminaires*/ /****************************************************/ $j("#addCoursALaCarteDetail").click(function (e) { $j('#tableCoursALaCarteDetail tbody tr:last').clone(true).insertAfter('#tableCoursALaCarteDetail tbody tr:last'); $j('#tableCoursALaCarteDetail tbody tr:last').find('input[name=\'idChamps[]\']').each(function() { $j(this).val(""); }); }); $j("a.deleteCoursALaCarteDetail").click(function (e) { e.preventDefault(); nbLigne = $j('#tableCoursALaCarteDetail tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); /***************************************************/ /* affichage champ choix lieu seminaire*/ /***************************************************/ /* $j('#choix_lieu[]').change(function(e) { if ($j(this).val()!=""){ $j.ajax({ type: "POST", url: "./include/ajax/affParamSeminaire.php", data: "idSeminaire="+$j("#idSeminaire[]").val()+"&idLieu="+$j("#choix_lieu[]").val(), async:false, success: function(msg){ $j('#divChoixDate').html(msg); } }); } }); */ /****************************************************/ /* Ajout choix cours sur page inscription*/ /****************************************************/ /* $j("#addVarianteDetail").click(function (e) { $j('#tableVarianteDetail tbody tr:last').clone(true).insertAfter('#tableVarianteDetail tbody tr:last'); $j('#tableVarianteDetail tbody tr:last').find('input[name=\'idChamps[]\']').each(function() { $j(this).val(""); }); }); $j("a.deleteVarianteDetail").click(function (e) { e.preventDefault(); nbLigne = $j('#tableVarianteDetail tbody tr').length; if (nbLigne > 1){ $j(this).parents("tr").eq(0).remove(); } }); */ $j('#sendNewsletter').live('click', function() { /* if($j("#newsletterForm").attr("action") != null){ $j.validator.messages.required = ""; $j("#newsletterForm").validate({ invalidHandler: function(e, validator) { $j("label.error").css("display","none"); alert("Veuillez vérifier les informations saisies"); }, submitHandler: function(form) { $j.ajax({ type: "POST", url: "./include/ajax/affichePopupNewsletter.php", data: "postForm="+$j("#postForm").val()+"&choixCoursFormation="+$j("#choixCoursFormation").val()+"&choixCoursALaCarte="+$j("#choixCoursALaCarte").val()+"&choixLieu="+$j("#choixLieu").val()+"&titre="+$j("#titre").val()+"&nom="+$j("#nom").val()+"&prenom="+$j("#prenom").val()+"&email="+$j("#email").val()+"&jeton="+$j("#jeton").val(), async:false, success: function(msg){ $j('#popupNewsletter').html(msg); $j('#popupNewsletter').dialog({ width: 400, height:200, modal: true, closeText: "", buttons: { Fermer: function() { $j( this ).dialog( "close" ); } } }); } }); } }); } */ }); /**************************************************/ /* POST du formulaire de orientation conseil contact*/ /*************************************************/ if($j("#conseilContactForm").attr("action") != null){ $j.validator.messages.required = ""; $j("#conseilContactForm").validate({ invalidHandler: function(e, validator) { $j("label.error").css("display","none"); alert("Veuillez vérifier les informations saisies"); }, submitHandler: function(form) { $j("label.error").css("display","none"); form.submit(); } }); } /***************************************************/ /*//Traductions*/ /***************************************************/ $j("button.addPageSite").click(function (e) { $j('#pageSite tbody tr:first').clone(true).insertAfter('#pageSite tbody tr:last'); $j('#pageSite tbody tr:last').css("display",""); }); $j("button.addModule").click(function (e) { $j('#moduleSite tbody tr:first').clone(true).insertAfter('#moduleSite tbody tr:last'); $j('#moduleSite tbody tr:last').css("display",""); }); $j(".deleteTr").click(function (e) { e.preventDefault(); $j(this).parents("tr").eq(0).remove(); }); }); function checkHover() { if (obj) { obj.find('ul').fadeOut('fast'); } } // Notification lorsqu'on enregistre l'�diteur function showConfirm(title,text){ $j.pnotify({ pnotify_title: title, pnotify_text: text, pnotify_notice_icon:"", pnotify_animation:"slide", pnotify_animate_speed: 'fast', pnotify_delay :3000, pnotify_history:false }); } function affPopupContent(idPage, reference){ $j.ajax({ type: "POST", url: "./include/ajax/affPopupContent.php", data: "idPage="+idPage+"&reference="+reference, async:false, success: function(msg){ $j('#affPopupContent').html(msg); $j('#affPopupContent').dialog({ width: 700, height:500, modal: true, closeText: '', buttons: { Fermer: function() { $j(this).dialog('close'); } } }); } }); } function choixCoursFormation (obj){ if ($j("#"+obj).val()!=""){ idObjet= obj; idLigne= idObjet.substr(20,idObjet.length); $j('.libelleLieuFormation').html("Lieu"); $j('#divChoixDateFormation_'+idLigne).html(""); $j.ajax({ type: "POST", url: "./include/ajax/affParamInscription.php", data: "typePage=1&idLigne="+idLigne+"&idFormation="+$j("#"+obj).val(), async:false, success: function(msg){ $j('#divChoixLieuFormation_'+idLigne).html(msg); } }); } } function choixCoursCoursALaCarte (obj){ if ($j("#"+obj).val()!=""){ idObjet= obj; idLigne= idObjet.substr(24,idObjet.length); $j('.libelleLieuCoursALaCarte').html("Lieu"); $j('#divChoixDateCoursALaCarte_'+idLigne).html(""); $j.ajax({ type: "POST", url: "./include/ajax/affParamInscription.php", data: "typePage=2&idLigne="+idLigne+"&idFormation="+$j("#"+obj).val(), async:false, success: function(msg){ $j('#divChoixLieuCoursALaCarte_'+idLigne).html(msg); } }); } } // jquery select custom (function($){ $.fn.extend({ customStyle : function(options) { if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){ return this.each(function() { var currentSelected = $(this).find(':selected'); $(this).after(''+currentSelected.text()+'').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')}); var selectBoxSpan = $(this).next(); var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right')); var selectBoxSpanInner = selectBoxSpan.find(':first-child'); selectBoxSpan.css({display:'inline-block'}); selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'}); var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom')); $(this).height(selectBoxHeight).change(function(){ // selectBoxSpanInner.text($(this).val()).parent().addClass('changed'); This was not ideal selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed'); // Thanks to Juarez Filho & PaddyMurphy }); }); } } }); })(jQuery);