如何将复选框ID传递给模式框? [英] How to pass checkbox id to the modal box?

查看:118
本文介绍了如何将复选框ID传递给模式框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何选中ID到模式框?

Possible Duplicate:
How to checkbox id to the modal box?

我有一个表,每行都有一个复选框和一个按钮.只要按下按钮,就会出现一个模式框,同时也将选中该复选框.

I have a table which each row have a checkbox and a button. whenever the button is pressed, a modal box will appear and at the same time the checkbox will get checked as well.

模式框将询问用户是否要删除特定记录.如果是,将提交表格.如果为否",则将取消选中该复选框.

The modal box will as ask user if want to delete particular record. If Yes, the form will be submitted. If No, the checkbox will be unchecked.

我面临着取消选中该复选框的问题.有人可以协助提供示例代码吗?如何将复选框ID传递给模式框,以便可以取消选中该特定复选框?

I am facing issue with getting the checkbox unchecked. Anyone can assist with sample code? How do I pass the checkbox id to the modal box so that that particular checkbox can be unchecked?

谢谢.

         var buttons3 = $("#yns button").click(function(e) { 
        // get user input
         var yes = buttons3.index(this) === 0;
         if (yes){
         $('form#form1').submit();
         return true;
         } 
        else{
         //How to get the particular Checkbox id so that it can be unchecked? 

$(this).dialog("close");

     return false;

     } 

    });

推荐答案

                                    <tr>                                        
                                        <td><input type="checkbox" id="measure<?php echo $count;?>" name="measureid[]" value="<?php echo $items>"></td>
                                        <td><?php  echo $Name;?></td>
                                        <td>
                                            <ul id="tip" class="abuttons">
                                                <li><a class="button"><span class="edit" title="Edit"></span></a></li>
                                                <li><a rel="#yns" id="unitbtn<?php echo $count;?>" class="modalInput button"><span class="delete" title="Delete"></span></a></li>
                                            </ul>
                                        </td>
                                    </tr>

这篇关于如何将复选框ID传递给模式框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆