I assume that the values you want to obtain are the texts that are in each of the td
of the row of the checkbox, for which we will search in the DOM the td
"father" of the selected checkbox and then we will find the other td
adjacent:
// para cada checkbox "chequeado"
$("input[type=checkbox]:checked").each(function(){
// buscamos el td más cercano en el DOM hacia "arriba"
// luego encontramos los td adyacentes a este
$(this).closest('td').siblings().each(function(){
// obtenemos el texto del td
console.log($(this).text());
});
});
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
</head>
<body>
<form id="formulario" name="formulario" action="">
<table>
<tr>
<td><input type="checkbox" name="elemento1" value="1"/></td>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento2" value="2" checked="checked" /></td>
<td>ddd</td>
<td>eee</td>
<td>fff</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento3" value="3" checked="checked"/></td>
<td>ggg</td>
<td>hhh</td>
<td>iii</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento4" value="4"/></td>
<td>jjj</td>
<td>kkk</td>
<td>lll</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento5" value="5"/></td>
<td>mmm</td>
<td>nnn</td>
<td>ooo</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento6" value="6"/></td>
<td>ppp</td>
<td>qqq</td>
<td>rrr</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento7" value="7"/></td>
<td>sss</td>
<td>ttt</td>
<td>uuu</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento8" value="8"/></td>
<td>vvv</td>
<td>www</td>
<td>xxx</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento9" value="9"/></td>
<td>yyy</td>
<td>zzz</td>
<td>AAA</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento10" value="10"/></td>
<td>BBB</td>
<td>CCC</td>
<td>DDD</td>
</tr>
</table>
<input type="submit" value="seleccionar" onclick=""/>
</form>
</body>
</html>
Modification to obtain the values selected as a string, separated by spaces:
// para cada checkbox "chequeado"
$("input[type=checkbox]:checked").each(function(){
var result = [];
var i = 0;
// buscamos el td más cercano en el DOM hacia "arriba"
// luego encontramos los td adyacentes a este
$(this).closest('td').siblings().each(function(){
// obtenemos el texto del td
result[i] = $(this).text();
++i;
});
console.log(result.join(' '));
});
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
</head>
<body>
<form id="formulario" name="formulario" action="">
<table>
<tr>
<td><input type="checkbox" name="elemento1" value="1"/></td>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento2" value="2" checked="checked" /></td>
<td>ddd</td>
<td>eee</td>
<td>fff</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento3" value="3" checked="checked"/></td>
<td>ggg</td>
<td>hhh</td>
<td>iii</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento4" value="4"/></td>
<td>jjj</td>
<td>kkk</td>
<td>lll</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento5" value="5"/></td>
<td>mmm</td>
<td>nnn</td>
<td>ooo</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento6" value="6"/></td>
<td>ppp</td>
<td>qqq</td>
<td>rrr</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento7" value="7"/></td>
<td>sss</td>
<td>ttt</td>
<td>uuu</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento8" value="8"/></td>
<td>vvv</td>
<td>www</td>
<td>xxx</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento9" value="9"/></td>
<td>yyy</td>
<td>zzz</td>
<td>AAA</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento10" value="10"/></td>
<td>BBB</td>
<td>CCC</td>
<td>DDD</td>
</tr>
</table>
<input type="submit" value="seleccionar" onclick=""/>
</form>
</body>
</html>
Modification (again), to obtain a single string with all the selected values:
var result = [];
var i = 0;
// para cada checkbox "chequeado"
$("input[type=checkbox]:checked").each(function(){
// buscamos el td más cercano en el DOM hacia "arriba"
// luego encontramos los td adyacentes a este
$(this).closest('td').siblings().each(function(){
// obtenemos el texto del td
result[i] = $(this).text();
++i;
});
});
console.log(result.join(' '));
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
</head>
<body>
<form id="formulario" name="formulario" action="">
<table>
<tr>
<td><input type="checkbox" name="elemento1" value="1"/></td>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento2" value="2" checked="checked" /></td>
<td>ddd</td>
<td>eee</td>
<td>fff</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento3" value="3" checked="checked"/></td>
<td>ggg</td>
<td>hhh</td>
<td>iii</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento4" value="4"/></td>
<td>jjj</td>
<td>kkk</td>
<td>lll</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento5" value="5"/></td>
<td>mmm</td>
<td>nnn</td>
<td>ooo</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento6" value="6"/></td>
<td>ppp</td>
<td>qqq</td>
<td>rrr</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento7" value="7"/></td>
<td>sss</td>
<td>ttt</td>
<td>uuu</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento8" value="8"/></td>
<td>vvv</td>
<td>www</td>
<td>xxx</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento9" value="9"/></td>
<td>yyy</td>
<td>zzz</td>
<td>AAA</td>
</tr>
<tr>
<td><input type="checkbox" name="elemento10" value="10"/></td>
<td>BBB</td>
<td>CCC</td>
<td>DDD</td>
</tr>
</table>
<input type="submit" value="seleccionar" onclick=""/>
</form>
</body>
</html>