禁止在提交表单时发送元素

Disable elements from been sent on form submission

我正在使用 serialize() 为了提交我的表单元素。我有一些单选按钮,用于在需要时启用某些文本框(类似于 that)。但是,单选按钮也会被提交,即使它们仅用于启用文本区域。

是否可以选择在提交表单后禁止发送它们?

以下代码只是我的单选按钮的示例:

$('.RadioExample').not('.First').siblings().prop('disabled',true);

$('.RadioExample').on('click',function(){
    $('.RadioExample')
        .siblings()
        .prop('disabled',true);
    
    $(this)
        .siblings()
        .prop('disabled',false);
});
#first {
    background-color: red;
}

#second {
    background-color: green;
}

#third {
    background-color: yellow;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<h1>Control fields</h1>
<div id="content">
    <div id="first">
            <input type="radio" name="radio" id="radio1" class="RadioExample First" checked="checked" />First</br>
            <input type="text" id="txt_one" /></br>
            <input type="text" id="txt_two" /></br>
    </div>
<div id="second">
    <input type="radio" name="radio" id="radio2" class="RadioExample" />Second</br>
<input type="text" id="three" /></br>
          <input type="text" id="txt_four" /></br>
    </div>

    <div id="third">
            <input type="radio" name="radio" id="radio3" class="RadioExample" />Third</br>
            <input type="text" id="txt_five" /></br>
            <input type="text" id="txt_six" /></br>
            <input type="text" id="txt_seven" /></br>
    </div>
</div>

为什么不 find 表单内的元素并使用 not

排除收音机
$('#formID').find('input').not("input[type='radio']").serialize()