我绝不是一个JavaScript程序员,所以这将是很好,如果有人可以帮助我与此。如果在下面的示例中有多个这些评分部分在同一页面上。Radiobutton的价值到MySQL没有提交
现在我需要将单击的单选按钮的值发送到我的数据库,而无需提交按钮,最好不用刷新。
<body>
<section class="rating">
<input type="radio" class="radio twenty" name="progress" value="twenty" id="twenty" <?php if($num === 1) { echo 'checked'; } ?>>
<label for="twenty" class="label">1</label>
<input type="radio" class="radio fourty" name="progress" value="fourty" id="fourty" <?php if($num === 2) { echo 'checked'; } ?>>
<label for="fourty" class="label">2</label>
<input type="radio" class="radio sixty" name="progress" value="sixty" id="sixty" <?php if($num === 3) { echo 'checked'; } ?>>
<label for="sixty" class="label">3</label>
<input type="radio" class="radio eighty" name="progress" value="eighty" id="eighty"<?php if($num === 4) { echo 'checked'; } ?>>
<label for="eighty" class="label">4</label>
<input type="radio" class="radio onehundred" name="progress" value="onehundred" id="onehundred" <?php if($num === 5) { echo 'checked'; } ?>>
<label for="onehundred" class="label">5</label>
<div class="progress">
<div class="progress-bar"></div>
</div>
</section>
</body>
我已经设置了检查单选按钮的检索,使其与到等级5的1对应,所以我目前使用TESTDATA显示1到5个等级。
我不一定需要所有的细节,对需要完成的步骤的概述已经非常有帮助。
我想说'做它改变',但后来意识到everythng然后发射 – EaterOfCode 2013-04-29 11:11:54
所以如果有'...',这不会发送'example.com'或'null'到'someserver.php'吗? – Dom 2013-04-29 11:25:17
是的,你要么不需要给其他项目的无线电广播,要么添加输入[type = radio]或输入[name = progress]给选择器 – mplungjan 2013-04-29 11:27:24