Bonjour,
mon but étant d'envoyer au serveur seulement les boutons radio qui ont changé de valeur pour ne traiter que ceux la.
Des que la personne clic sur un bouton radio, je stocke dans une variable data l'id et la valeur.
Le probleme vient quand je souhaite envoyer via la méthode jQuery.post, j'ai d'abord essayer avec cette ligne
jQuery.post(url, $("header").data,function(data){}, "json");
cela n'a pas marché. Alors j'ai voulu faire un test simple
jQuery.post(url, {test:"resr"},function(data){}, "json");
mais cela ne fonctionne pas non plus quand je fait un
echo print_r($_POST);
j'ai lu que le faite de tourner sous ie6 ne posé pas de problème, je ne vois pas d'où vient le problème, merci d'avance et bonne journée.
Code Html
<script src="../../../objets/jquery/jquery.js" type="text/javascript"></script>
<script src="js/test.js" type="text/javascript"></script>
</head>
<body>
<form name='form_saisie' method='post' action='inc/traitement_saisie_siege_new.php' id="submit">
<div align=right><input type='button' value='Retour Menu'
class='perso_bouton_input' onClick="window.location.href='menu.php';" />
<input type='button' id='btn_valid' value='Valider'
class='perso_bouton_input' onClick="valider();" /> <img
src='inc/icon_exel.gif' onClick="window.location.href='xls_saisie.php'" />
<br>
<DIV id='header' class='tabloScroll_liste'
style='width: 100%; height: 295px; position: relative;'>
<table border='0' align='center' cellspacing='1' cellpadding='0'
bordercolor='#000000' bgcolor='#000000' id='tab_saisie' width='95%'>
<!-- // affichage d'une ligne avec les données du partenaire-->
<tr id='9773'>
<td class='tab_cell' width='21%'>....</td>
<td class='tab_cell' width='8%'><SPAN STYLE='font-size: 11px'>....</span></td>
<td class='tab_cell' width='9%'>...</td>
<td class='tab_cell' width='7%'>...</td>
<td class='tab_cell' width='7%'><b>...</b></td>
<td class='tab_cell' width='9%'>...</td>
<td class='tab_cell' width='3%'><input type='radio'
name='rad_saisie' value='crea' id='crea_9773'
disabled onClick="check_autre_motif('crea_',9773);" />
</td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='forf'
id='9773' width='2%'
onClick="check_autre_motif('forf_',9773);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='micro' id='9773' width='2%'
onClick="check_autre_motif('micro_',9773);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='wait'
id='9773' width='2%'
onClick="check_autre_motif('wait_',9773);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='ana'
id='9773' width='2%'
onClick="check_autre_motif('ana_',9773);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='sana'
id='9773' width='2%'
onClick="check_autre_motif('sana_',9773);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='9773' value='ssap'
id='9773' width='2%'
onClick="check_autre_motif('ssap_',9773);check_siret_saphyre();" /></td>
<!-- name='rad_saisie_2' -->
<td class='tab_cell' width='8%'>
<input type='text' name='9773' id='9773' width='8%' value='' size='8' />
</td>
<td class='tab_cell'>
<div id='atmotif'><img id='img_9773'
src='../../../objets/images/selection_ko.gif'
onClick='popup(9773,0);' /></div>
</td>
<td class='tab_cell' width='3%'>...</td>
<td class='tab_cell' width='3%'><img
id='img_drop_9773' src='inc/b_drop.png'
onClick='dropline(9773)'></td>
</tr>
<tr id='3298'>
<td class='tab_cell' width='21%'>...</td>
<td class='tab_cell' width='8%'><SPAN STYLE='font-size: 11px'>...</span></td>
<td class='tab_cell' width='9%'>...</td>
<td class='tab_cell' width='7%'>...</td>
<td class='tab_cell' width='7%'><b>...</b></td>
<td class='tab_cell' width='9%'>...</td>
<td class='tab_cell' width='3%'><input type='radio' name='rad_saisie' value='crea'
id='crea_3298'
disabled onClick="check_autre_motif('crea_',3298);" />
</td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='forf'
id='3298' width='2%'
onClick="check_autre_motif('forf_',3298);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='micro'
id='3298' width='2%'
onClick="check_autre_motif('micro_',3298);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='wait'
id='3298' width='2%'
onClick="check_autre_motif('wait_',3298);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='ana'
id='3298' width='2%'
onClick="check_autre_motif('ana_',3298);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='sana'
id='3298' width='2%'
onClick="check_autre_motif('sana_',3298);" /></td>
<td class='tab_cell' width='3%'><input type='radio'
name='3298' value='ssap'
id='3298' width='2%'
onClick="check_autre_motif('ssap_',3298);check_siret_saphyre();" /></td>
<!-- name='rad_saisie_2' -->
<td class='tab_cell' width='8%'><input type='text'
name='3298' id='3298' width='8%' value='' size='8' /></td>
<td class='tab_cell'>
<div id='atmotif'><img id='img_3298' src='../../../objets/images/selection_ko.gif'
onClick='popup(3298,0);' /></div>
</td>
<td class='tab_cell' width='3%'>...</td>
<td class='tab_cell' width='3%'><img
id='img_drop_3298' src='inc/b_drop.png'
onClick='dropline(3298)'></td>
</tr>
</table>
<input type='hidden' name='test' id='test'/>
<br>
<br>
<div align=right><input type="button" value="Retour Menu"
class="perso_bouton_input" onClick="window.location.href='menu.php';" />
<input type="submit" value="submit"/>
</form>
</body>
</html>
Code jQuery
$(function() {
$('input:radio').change(function(){
var agc = $(this).val();
var agc_key = $(this).attr("id");
/*$.each($("#header").data(), function(key, value) {
alert(key + "=" + value);
});
*/
$("#header").data(agc_key, agc);
});
$("#submit").submit(function(){
var url = $(this).attr("action");
jQuery.post(url, $("header").data,function(data){}, "json");
//jQuery.post( url , data] , success(data, textStatus, jqXHR)] , dataType] )
});
});