I'm a jquery beginer. I want to use the load function in a special way, the datas should be defined by th sript, depending on which part of my form I'm posting. My code is the following :
$(".form_param").change(function(){ var param_val = $(this).val(); var param_nom = $(this).attr("name"); $("#moniteur").load("session_maj.php", {param_nom: param_val}); }); The .form_param class is the class of the form elements (select, checkbox...), and I get the value (param_val) on change, an the name of the element (param_nom). I would like to post it, saying something like : {param_nom: param_val}. The problème is that in this way, the name of the posted data is always "param_nom" ; I get $_POST['param_nom'] Is there a way to do what I want in a simple Jquery way ? Patrick