function addOption(idProduit, prixArticle, curOptionId, curOptionValue, curOptions) { jQuery('#optionsArticle').fadeOut(10); jQuery('#resumePrix').fadeOut(10); jQuery.post("applications/jquery/ajax/actions/actions.php", {lg: "fr", action: "resumePrix", id_produit: idProduit, prix_article: prixArticle, curOptionId: curOptionId, selectedOptionValue: curOptionValue, allOptions: document.forms['ajouter_form'].options_txt.value}, function(data){ document.getElementById('resumePrix').innerHTML = data; jQuery('#resumePrix').fadeIn("slow"); }); jQuery.post("applications/jquery/ajax/actions/actions.php", {lg: "fr", action: "addOption", id_produit: idProduit, curOptionId: curOptionId, selectedOptionValue: curOptionValue, allOptions: document.forms['ajouter_form'].options_txt.value}, function(data){ document.getElementById('optionsArticle').innerHTML = data; jQuery('#optionsArticle').fadeIn("slow"); }); optionsValeurs = document.forms['ajouter_form'].options_txt.value; arrayOptionsValeurs = new Array(); arrayOptionsValeurs = optionsValeurs.split('|'); document.forms['ajouter_form'].options_txt.value = ""; for ( keyVar in arrayOptionsValeurs ) { idValue = arrayOptionsValeurs[keyVar]; arrayIdValue = idValue.split('='); id = arrayIdValue[0]; value = arrayIdValue[1]; if(id==curOptionId){ document.forms['ajouter_form'].options_txt.value += id+"="+curOptionValue; } else{ document.forms['ajouter_form'].options_txt.value += id+"="+value; } if((arrayOptionsValeurs.length-1)!=(keyVar)){ document.forms['ajouter_form'].options_txt.value += "|"; }; } };