脚本有效,但单击的单选按钮未选中=选中 jquery ajax POST

发布于 2024-09-11 13:36:37 字数 666 浏览 1 评论 0原文

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

//脚本有效,但是点击收音机未选中=已选中 //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", .....

有人可以帮助我吗?谢谢

to see the error:
http://jsfiddle.net/sEdGz/2/

//the script works, but the clicked radio isn't checked=checked
//mysql and php works good

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

I want to get this:

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

Can anybody help me? thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

攒一口袋星星 2024-09-18 13:36:37

原因是您的返回 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
    });    
});

The reason is your return false.

This will work:

$('#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
    });    
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文