dt3358 2013-10-26 17:04
浏览 43
已采纳

Jquery点击不触发

I am using a while loop to create a table and I am trying to pass a unique value stored in a php variable called $i to a jquery ajax call but all I get returned it 'undefined'.

The portion of the html table (whole table is wrapped in a div called audit_content which is not part of the while loop)

  <tr>
      <td colspan="3">
          <input type="button" class="delete_submit delete_from_audit" name="image_delete" value="" 
               onClick="delete_image('<? echo $image_id; ?>','<? echo $audit_id; ?>')" />
          <input type="button" class="reset_grade control_submit ie7_reset" 
               onclick="reset_image('<? echo $image_id; ?>','<? echo $audit_id; ?>')" value="" >
          <input type="hidden" class="form_id" value="<? echo $i; ?>" >
          <input type="button" name="audit_submit"
            class="audit_submit audit_submit_btn ie7_submit" value=""; />
      </td>
  </tr> 

the Jquery

<script>
  $(document).ready(function(){
    $('#audit_content').on("click", ".audit_submit", function(){
        var form_id = $(this).next('.form_id').val();
        alert(form_id);
           //$.ajax({
           //type: "POST",
           //url: "ajax/image_audit.php",
           //data: $('#audit_form').serialize()
        //});
    });
});
</script>
  • 写回答

3条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 从零开始汽车自动驾驶相关的软件学习
      • ¥30 操作系统进程实验虚拟机
      • ¥15 yolov5摄像头识别只能检测第一帧图像
      • ¥15 有没有可以下载钉钉群文件视频的软件
      • ¥15 如何用LaTeX打出如下的表格
      • ¥15 程序填空补充完整的代码一共三题
      • ¥15 在MySQL中使用while建表,报错
      • ¥15 python导入pyautogui报错,网上也没有找到解决方法如何解决?
      • ¥15 关于IPSEC和NAT SERVER同时使用的情况下,该如何解决客户端访问服务器的问题
      • ¥15 eclipse项目在idea运行部署到云服务器