2010-07-26 2 views
1

pour voir l'erreur: http://jsfiddle.net/sEdGz/2/fonctionne script, mais la radio cliqué n'est pas cochée = cochée jquery ajax POST

// le script fonctionne, mais la radio cliqué n'est pas cochée = vérifié // mysql et php fonctionne bien

$('#form1').live("click change", function() { .... 
<div class='divtoclick'>neu berechnen</div> 
<form id="form1" method="post" name="bestellformular"> 

<input value="101" name="flyer_anzahl" type="radio" /> 1.000 
<input name="flyer_anzahl" type="radio" value="102" checked="checked"/> 
... 

Je veux obtenir ceci:

$('#form1').find('.divtoclick').live("click", ..... 
$('input#form1').live("change", ..... 

Quelqu'un peut-il me aider? thx

Répondre

1

La raison en est return false.

Cela fonctionne:

$('#form1').live("click change", function() { 
     $.ajax({ 
     type : "POST", 
     cache : false, 
     url  : "berechnung_ajax.php", 
     data : $(this).serializeArray(), 
     success : function(data) { 
         $('#berechnung').html(data); 
     }}); 

    return true; // return true in order not to prevent the event 
    });  
}); 
Questions connexes