我正在尝试将数据输入到我的数据库中,并且没有一个单选按钮被粘住。无论我将它们更改为什么,它们都保持不变。他们最初进入就好(无论第一个按钮是什么,都会成功出现)。
<script type="text/javascript">
$(document).ready(function () {
$('#loadingstart').hide();
});
function walle() {
$('#loadingstart').show();
var product_id_array = $('#product_id_array').val();
var position = $('#position').val();
var URL = "./includes/user-course-settings.php"; /////post.php will be equal the variable "comment"
$.post(URL,
{
walle: "post",
username1: username,
position1: position,
navpos1: navpos
},
function (data) {//parameter wall will be equal "post", name1 will be equal to the var "name" and comment1 will be equal to the var "comment"
$("#startOver").prepend(data).show();// the result will be placed above the the #result div
$('#loadingstart').hide();
});
}
</script>
我不认为 MYSQLI 有什么特别的问题,因为它最初确实进入了数据库。问题是,无论我选择什么值,都会在分组单选按钮中保留第一选择。
<div id="form">
<form>
<input type="hidden" id="product_id_array" value="'.$product_id_array.'" />
<div class="separateFormInput">
<div class="radioFormQuestion">position</div>
<div class="leftyRadio">
<li>
<input type="radio" id="position" name="position" value="left" checked="checked" />left</li>
<li>
<input type="radio" id="Radio1" name="position" value="center">center</li>
<li>
<input type="radio" id="Radio2" name="position" value="right">right</li>
</div>
<br />
<hr>
</div>
<div class="separateFormInput">
<div class="radioFormQuestion">Nav Position?</div>
<div class="leftyRadio">
<li>
<input type="radio" name="navpos" value="Left" checked="checked" />Left</li>
<li>
<input type="radio" name="navpos" value="Center">Center</li>
<li>
<input type="radio" name="navpos" value="Right">Right</li>
</div>
<br />
<hr>
</div>
<!--submit form here-->
<div class="submit" id="textRight">
<input type="submit" name="button" id="button" value="Submit" onclick="return false" onmousedown="javascript:walle();" />
<img src="https://www.mysite.com/images/loading.gif" alt="" width="15" height="15" id="loadingstart" />
</div>
<div id="startOver" style="clear: both; font-weight: normal; font-size: 12px;"></div>
</form>
</div>