This is my form:
<form action="/Admin/usuarios/obtener_valores" method="POST">
<div class="span-16">
<input type="hidden" value="1" name="usuarioPinIdHidden" id="usuarioPinIdHidden">
<table class="summary" style="border: none;">
<tr>
<td colspan="2">¿A que edad tuvo sus primeras vacaciones?</td>
</tr>
<tr>
<td colspan="2"><input id="text@'+1+^+1" name="respuesta[0].respuesta" type="text" value=""/></td>
</tr>
<tr>
<td colspan="2">¿Estaba casado en 1991?</td>
</tr>
<tr>
<td colspan="2"><input id="boolean@'+3+^+1" name="respuesta[1].respuesta" type="radio" value="true"/>
<label for="boolean@'+3+^+1">Si</label>
<br />
<input id="boolean@'+3+^+1" name="respuesta[1].respuesta" type="radio" value="false"/>
<label for="boolean@'+3+^+1">No</label></td>
</tr>
</table>
</div>
This is a function to print all the id values after clicking the submit button:
$(document).ready(function() {
$('form').submit(function (){
return verificarRespuestas();
});
});
function verificarRespuestas(){
alert('hola');
$('form').children().each(function(){
var child = $(this);
alert(child.id);
});
return false;
}
but this is what it's printed:
- hola
- undefined
- undefined
when I expect to get these values:
- hola
- text@'+1+^+1
- boolean@'+3+^+1
What am I doing wrong?
Thanks in advance!