我有一大堆的单选按钮的动态生成的名字象下面这样:如何获得单选按钮的值与动态生成的名字
<input type="radio" id="Red<?php echo $wineID; ?>" name="category<?php echo $wineID; ?>" value="Red" <?php if ($category == "Red") { ?>checked="true"<?php } ?>>
<label for="Red<?php echo $wineID; ?>">Red</label>
<input type="radio" id="White<?php echo $wineID; ?>" name="category<?php echo $wineID; ?>" value="White" <?php if ($category == "White") { ?>checked="true"<?php } ?>>
<label for="White<?php echo $wineID; ?>">White</label>
<input type="radio" id="Sparkling<?php echo $wineID; ?>" name="category<?php echo $wineID; ?>" value="Sparkling" <?php if ($category == "Sparkling") { ?>checked="true"<?php } ?>>
<label for="Sparkling<?php echo $wineID; ?>">Sparkling</label>
我需要选择的值,并将其添加到我的dataString为一个Ajax调用来更新我的数据库。这怎么可以使用jQuery来完成?
这个工作。非常感谢! –