0

我无法将单选按钮上传到 mysql 以查看它们是否被选中,我正在使用一个名为:star rating 的 jquery 插件并且没有运气。刷新页面时,我还需要保留星星。

<script language="javascript">
$(document).ready(function(e) {
    $(".check").bind('click', function(){
        var box_id= $(this).attr("id").split("_")[$(this).attr("id").split("_").length-1];
        //console.log($(this).prop("checked") + " " + $(this).val());
        writeListValue(10,box_id,$(this).prop("checked"));
    });
    });
</script>
<form name="strategies" action="" onsubmit="return verifyIt();" method="post">
    <input type="hidden" id="from" name="from" value="strategies" />
    <input type="hidden" id="direction" name="direction" value="" />

    <table  width="100%" style="margin-left:25px" >
     <tr>
        <td><input name="star1" class="star check" id="star1" type="radio" value="" />
        <input name="star1" class="star" id="star1" type="radio" value="" />
        <input name="star1" class="star" id="star1" type="radio" value="" />
        <input name="star1" class="star" id="star1" type="radio" value="" />
        <input name="star1" class="star" id="star1" type="radio" value="" /></td>
        <td><label for="star1">Catch myself before spiraling downward</label></td>
        </tr>
      <tr>
        <td><input name="star2" class="star" id="star2" type="radio" value=""  />
        <input name="star2" class="star" id="star2" type="radio" value="" />
        <input name="star2" class="star" id="star2" type="radio" value="" />
        <input name="star2" class="star" id="star2" type="radio" value="" />
        <input name="star2" class="star" id="star2" type="radio" value="" /></td>
        <td><label for="star2">Accepting who I am and my body shape</label></td>
        </tr>
      <tr>
        <td><input name="star3" class="star" id="star3" type="radio" value="" />
        <input name="star3" class="star" id="star3" type="radio" value="" />
        <input name="star3" class="star" id="star3" type="radio" value="" />
        <input name="star3" class="star" id="star3" type="radio" value="" />
        <input name="star3" class="star" id="star3" type="radio" value="" /></td>
        <td><label for="star3">Doing pleasant activities</label></td>
        </tr>
      <tr>
        <td><input name="star4" class="star" id="star4" type="radio" value="" />
        <input name="star4" class="star" id="star4" type="radio" value="" />
        <input name="star4" class="star" id="star4" type="radio" value="" />
        <input name="star4" class="star" id="star4" type="radio" value="" />
        <input name="star4" class="star" id="star4" type="radio" value="" /></td>
        <td><label for="star4">Remember my reasons for staying quit</label></td>
        </tr>
      <tr>
        <td><input name="star5" class="star" id="star5" type="radio" value="" />
        <input name="star5" class="star" id="star5" type="radio" value="" />
        <input name="star5" class="star" id="star5" type="radio" value="" />
        <input name="star5" class="star" id="star5" type="radio" value="" />
        <input name="star5" class="star" id="star5" type="radio" value="" /></td>
        <td><label for="star5">Not overreacting to my extreme thoughts</label></td>
        </tr>
      <tr>
        <td><input name="star6" class="star" id="star6" type="radio" value="" />
        <input name="star6" class="star" id="star6" type="radio" value="" />
        <input name="star6" class="star" id="star6" type="radio" value="" />
        <input name="star6" class="star" id="star6" type="radio" value="" />
        <input name="star6" class="star" id="star6" type="radio" value="" /></td>
        <td><label for="star6">Using relaxation exercises</label></td>
        </tr>
      </table></form> 
      <jsp:include page="/data/loadRadioButton.jsp" flush="true">
<jsp:param name="list_name" value="star_"></jsp:param>
<jsp:param name="list_id" value="10"></jsp:param>
</jsp:include>       
      </div>
  </div></div>
4

0 回答 0