Aktualnie mam taki kod :
<HEAD> </HEAD> <form action="index.php" method="post"> <table class="ipb_table"> <tbody> <tr class="header"> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> <td align="left"> <select id="charsex" name="charsex" class="input_text" style="min-width: 158px;"> </select> </td> </tr> </tbody> </table> <div id="sMale" style="display:none;"> <img src="http://localhost/f/public/gp/skins/2.png" class="skins" id="2" style="margin-top: 3px;" /> <img src="http://localhost/f/public/gp/skins/7.png" class="skins" id="7" style="margin-top: 3px;" /> </div> <div id="sFemale" style="display:none;"> <img src="http://localhost/f/public/gp/skins/9.png" class="skins" id="9" style="margin-top: 3px;" /> <img src="http://localhost/f/public/gp/skins/12.png" class="skins" id="12" style="margin-top: 3px;" /> </div> </form> <script type="text/javascript"> jQuery(".skins").click( function () { if( jQuery("#sid").val() != jQuery(this).attr("id")){ jQuery(".skins").fadeTo("fast", 0.33); jQuery(this).fadeTo("fast", 1); jQuery("#sid").val( jQuery(this).attr("id") ); } else { jQuery(".skins").fadeTo("slow", 1); jQuery("#sid").val(""); } }); jQuery("#charsex").change( function () { if(jQuery(this).val() == '1') { jQuery("#sMale").show("slow"); jQuery("#sFemale").hide("slow"); } else if (jQuery(this).val() == '0') { jQuery("#sFemale").show("slow"); jQuery("#sMale").hide("slow"); } else { jQuery("#sMale").hide("slow"); jQuery("#sFemale").hide("slow"); } }); $('.skins').click(function(event) { $.post('index.php', {'id' : $(this).attr('id')}, function(data) { }) }); </script> <?php echo $_POST['id']; echo "<br/>"; echo $_POST['imie']; echo "<br/>"; echo $_POST['nazwisko']; echo "<br/>"; echo $_POST['charage']; echo "<br/>"; exit(); ?>
Z zamierzeniem, aby $_POST['id'] wyrzucił ID obiektu, który użytkownik wybrał. Niestety, tak się nie dzieje, nic nie zostaje odesłane. Co robię źle?