Reputation: 3378
This is probably simple for some of you, but I'm having trouble with it. I want to get the value of the first TD in the TR of the TD that has a checkbox that has been checked. The line of code to alert the CSS of the nth-child is just my last attempt at selecting the TD.
$('.notdupe').live('click', function (e) {
//alert("indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"));
$.ajax({
type: "POST",
url: "cfc/basic.cfc?method=SetNotDupe",
data: "indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"),
error: function (xhr, textStatus, errorThrown) {
// show error alert(errorThrown);
}
});
alert($(e.target:nth-child(-10)).css);
});
<td class="dupegroup">#dupe_group_number#</td>
<td><input type="checkbox" name="UserIDList" value="#userid#" /></td>
<td><a href="#request.controlURL#individuals/?fa=viewIndiv" target="_blank">#userid</td>
<td>#lastname#</td>
<td>#firstname#</td>
<td>#nickname#</td>
<td>#companyname#</td>
<td>#address1#</td>
<td>#zipcode#</td>
<td>#state#</td>
<td>client</td>
<td align="center"><input class="notdupe" type="checkbox" name="indivID" value="#userid#" checked /></td>
Upvotes: 1
Views: 991
Reputation: 76880
You could try
$('.notdupe').live('click', function (e) {
//alert("indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"));
$.ajax({
type: "POST",
url: "cfc/basic.cfc?method=SetNotDupe",
data: "indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"),
error: function (xhr, textStatus, errorThrown) {
// show error alert(errorThrown);
}
});
alert($(this).closest('tr').find('td:first').text());
});
Upvotes: 1