单选按钮情况下奇怪的PHP错误行为

单选按钮情况下奇怪的PHP错误行为,php,Php,这是html格式 <div class="formText"> <input type="radio" name="txtNumber" value="100" onclick="uncheck();"/>100 <input type="radio" name="txtNumber" value="200" onclick="uncheck();"/>200 <input type="radio" name="txtNumber

这是html格式

<div class="formText">
    <input type="radio" name="txtNumber" value="100" onclick="uncheck();"/>100
    <input type="radio" name="txtNumber" value="200" onclick="uncheck();"/>200
    <input type="radio" name="txtNumber" value="500" onclick="uncheck();"/>500
    <input type="radio" name="txtNumber" value="other" onclick="check(this);"/>other
    <input type="text" name="other_field" id="other_field" onblur="checktext(this);"/>
</div>
&插入查询 $insert=“插入dbForm(db_number)值(“{$choice_no}”)”

现在此窗体显示4个无线电选项,3个是固定的,一个是隐藏的。最后一个是可见的,当家伙点击“其他”单选按钮

现在,当选择以上三个值为100、200或500的单选按钮时,它们是好的,并且这些值将进入数据库

使用此代码时,不会拾取“其他”字段的值,而是始终在数据库中插入“0”。。
我很惊讶。

您没有为其他字段复选框定义值。用这个也许会对你有帮助

 <input type="text" name="other_field" id="other_field" value="value" onblur="checktext(this);"/>


请添加您的php代码。第四个按钮的值是
value=“other”
。是否将其保存在数据库中为
int
varchar\char
?@bborisovs我将其保存在数据库中为int。。因为other的值始终是从textfield@TobiasZander添加了代码,您在上面的PHP代码中从哪里获取“other_field”值?不需要
text
字段来定义
value
属性,获取输入的内容。
 <input type="text" name="other_field" id="other_field" value="value" onblur="checktext(this);"/>