/*lorsque qu'on change une donnée du formulaire*/
// on bind tous les types de champs des formulaires pour envoyer le formulaire
// via ajax et faire disparaitre les messages d'erreur si c'est corrigé.

 jQuery(document).ready(function(){
/*    
   // Formulaires produits
   var CodeNomForm = jQuery("#CODE_NOM_FORM").val();
   var optionsOnchange = { 
	        success:       onChangeGestionErreurXML,      // post-submit callback  
	        url:           '/Site/Produits/majMessageErreur.php?AJAX=OUI&NOM_FORM='+CodeNomForm,
	        type:          'post'
	    }; 	     
	    
	 // Formulaire Client
	 var CodeFormClient = jQuery("#CODEFORMCLIENT").val();
   var optionsOnchangeCompteClient = { 
	        success:       onChangeGestionErreurXML,     
	        url:           "majMessageErreur.php?AJAX=OUI&FORM="+CodeFormClient,
	        type:          'post'
	    }; 	     
   
	    
	        
   jQuery("select").change(function () 
   { 
   	jQuery('#myform').ajaxSubmit(optionsOnchange);
   	jQuery('#form_modif_client').ajaxSubmit(optionsOnchangeCompteClient);
   	jQuery('#myform_creationCompte').ajaxSubmit(optionsOnchangeCompteClient);
   });
   
   jQuery("input").change(function ()  
   { 
   	jQuery('#myform').ajaxSubmit(optionsOnchange);
   	jQuery('#form_modif_client').ajaxSubmit(optionsOnchangeCompteClient);
   	jQuery('#myform_creationCompte').ajaxSubmit(optionsOnchangeCompteClient);
   });
*/
});



 jQuery(document).ready(function(){
      
   jQuery("select").change(function () 
   {
   		//jQuery('#MSG_'+this.name).html('');   	
   		if(jQuery('#CODE_PRODUIT').val()=="AUTO")
   		{
   			jQuery(".msg").html("");
   			if(jQuery("#MODIFICATION") && jQuery("#MODIFICATION").val()!="OUI")
   			{
   				jQuery("#MODIFICATION").val("OUI");
   				jQuery.ajax({url:"/Site/Produits/modif_form.php?AJAX=OUI"});   
   			}		
   		}
   }
   );
   jQuery("input").change(function () 
   {
   		if(jQuery('#CODE_PRODUIT').val()=="AUTO")
   		{
   			jQuery(".msg").html("");
   			if(jQuery("#MODIFICATION") && jQuery("#MODIFICATION").val()!="OUI")
   			{
   				jQuery("#MODIFICATION").val("OUI");
   				jQuery.ajax({url:"/Site/Produits/modif_form.php?AJAX=OUI"});   
   			}
   		}
   }
   );
   

});



