繁体   English   中英

单击按钮后如何在特定的TD中编辑值

[英]How to edit value in a specific td after clicking button

这是我的button

<button id="Modify" role="button" class="btn btn-warning" disabled>Modify</button>

这是我的“ Modify button脚本

$("#Modify").click(function(e) {
    e.preventDefault();
    var id = $('#cLoanOut2 tr.active').attr('id');
    bootbox.confirm("Are you sure you want to modify this order?","No","Yes",function(r){
        if(r) {
            $.ajax({  
                url : "<?php echo $server_name; ?>/emcis_coopmain/process/PHP_groceryReleasingProcess.php",
                type : "POST",
                async : false,
                data : {
                    empgrocmstID:id,
                    todo:"Modify"
                },
                success:function(result){
                    bootbox.alert('Order Modified',function(){
                    $("#Modify").attr("disabled", true);
                    });
                    loadTable();
                }
            });   
        } else {

        }
    });
});

和我的phptd

$html .= "<td class='qty_ordered' style='text-align:right'>$qty_ordered</td>";

单击修改按钮后,如何在该td上编辑值?

谢谢你的帮助

如果该类是特定于该<td><td>

$("td.qty_ordered").html("<Your new value here>");

另外,如果我的假设是正确的,则可以在ajax()调用中的success()函数内更改td值。

马部海!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM