开发者

selection of checkbox in facebox and jquery?

HTML:

{% for item in result %}
       <tr id="row">
         <td><input name="item" type="checkbox" value="{{ item.number }}"></td>
         <td contenteditable id="col1">{{ item.foo }}</td>
         <td contenteditable id="col4">{{ item.bar }}</td>
       </tr>
{% endfor %} 

I am using 开发者_JAVA技巧facebox . Where I want to show the single row in the facebox which ever i checked ( checked the checkbox, which is in first <td> ). Jquery is:

 $(document).ready(function() {
    $('#edit').click(function() {
        jQuery.facebox({ div: '#row' })
        return false;
    });
});

This jquery is giving me the first row only.


You cannot use the same "id" value for more than one element in a page.

You can change that from "id" to "class" and it (might) work. It's hard to tell what exactly you're doing.

  <tr class='row'>
    <!-- ... -->
  </tr>

then

    // ...
    jQuery.facebox({div: '.row'});

Of course you could just find the <tr> elements directly:

    jQuery.facebox({div: 'tr'});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜