【问题标题】:script works, but the clicked radio isn't checked=checked jquery ajax POST脚本有效,但未选中单击的收音机=选中 jquery ajax POST
【发布时间】:2011-03-21 00:46:09
【问题描述】:

查看错误: http://jsfiddle.net/sEdGz/2/

//脚本有效,但是点击的radio没有checked=checked //mysql和php很好用

$('#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"/>
... 

我想得到这个:

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

有人可以帮助我吗?谢谢

【问题讨论】:

    标签: jquery ajax post radio-button checked


    【解决方案1】:

    原因是你的return false

    这将起作用:

    $('#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
        });    
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      • 1970-01-01
      • 2017-07-22
      • 2013-04-26
      • 1970-01-01
      • 2020-11-14
      • 1970-01-01
      相关资源
      最近更新 更多