私信  •  关注

Rohit Mittal

Rohit Mittal 最近创建的主题
Rohit Mittal 最近回复了
6 年前
回复了 Rohit Mittal 创建的主题 » 如何根据是否选中单选按钮交换按钮(使用jQuery)

当选中任何复选框时,应设置默认视图,请尝试以下代码:

jQuery(function () {
    jQuery(".addressRadio").change(function() {
        if (jQuery(this).is(":checked")) {
            jQuery(document).find(".selectedAddressButton").hide(); // To hide all select buttons
            jQuery(document).find(".deliverButton").show(); //To show all deliver button                 
            jQuery(this).siblings().find(".selectedAddressButton").show();
            jQuery(this).siblings().find(".deliverButton").hide();
        } else {
            jQuery(this).siblings().find(".selectedAddressButton").hide();
            jQuery(this).parents().find(".deliverButton").show();
        }
    });

6 年前
回复了 Rohit Mittal 创建的主题 » 在jQuery不工作的情况下提交之前更改表单POST数据

可以按以下方式设置JSON格式的值:

jQuery(document).on('submit', '#login-form', function () {
    var someVarialbel = 20;
    jQuery('input[data-key=webauthn_result]').val(JSON.stringify(['success', someVarialbel]));
});

希望对你有帮助!