[jQuery] Re: How to remove a row knowing the value of a checkbox.

2009-05-12 Thread Massimiliano Marini

Hi Paul,

 Try this
 
 var xxx = 5;
 $('input:attr[value='+xxx+']').parents('tr').remove();

works like a charm. Thanks 1K


[jQuery] Re: How to remove a row knowing the value of a checkbox.

2009-05-11 Thread waseem sabjee
function removebox(value) {
var obj = $(.mouseOver input);
for(var i = 0; i  obj.length; i++) {

if(obj.eq(i).attr(value) == 5) {
obj.eq(i).remove();
break;
}

}
}

On Mon, May 11, 2009 at 11:03 PM, m...@linuxtime.it m...@linuxtime.it wrote:


 Hi all,

 how do I remove a row of a table by knowing the value (returned by a PHP
 script) of the checkbox which is inside a cell?

 Example, the value is 5.

 How can I remove the line containing the checkbox with the value 5?

 table
 tr class=mouseOver
  tdinput type=checkbox value=1 name=chk[]//td
  tdfoo/td
 /tr
 tr class=mouseOver
  tdinput type=checkbox value=5 name=chk[]//td
  tdfoo2/td
 /tr
 
 tr class=mouseOver
  tdinput type=checkbox value=10 name=chk[]//td
  tdfoo2/td
 /tr
 /table




[jQuery] Re: How to remove a row knowing the value of a checkbox.

2009-05-11 Thread Massimiliano Marini

Sorry,

the right question is:

How can I remove the entirely row containing the checkbox with the value for 
example 5?

The value is returned to me by a PHP script, and of course is always different.

table
 tr class=mouseOver
   tdinput type=checkbox value=1 name=chk[]//td
   tdfoo/td
 /tr
 tr class=mouseOver
   tdinput type=checkbox value=5 name=chk[]//td
   tdfoo2/td
 /tr
 tr class=mouseOver
  tdinput type=checkbox value=10 name=chk[]//td
   tdfoo2/td
 /tr
/table


[jQuery] Re: How to remove a row knowing the value of a checkbox.

2009-05-11 Thread Paul Mills

Hi,
Try this

var xxx = 5;
$('input:attr[value='+xxx+']').parents('tr').remove();

Paul

On May 11, 8:37 pm, Massimiliano Marini m...@linuxtime.it wrote:
 Sorry,

 the right question is:

 How can I remove the entirely row containing the checkbox with the value for 
 example 5?

 The value is returned to me by a PHP script, and of course is always 
 different.

 table
  tr class=mouseOver
    tdinput type=checkbox value=1 name=chk[]//td
    tdfoo/td
  /tr
  tr class=mouseOver
    tdinput type=checkbox value=5 name=chk[]//td
    tdfoo2/td
  /tr
  tr class=mouseOver
   tdinput type=checkbox value=10 name=chk[]//td
    tdfoo2/td
  /tr
 /table