I am trying to send some values from AJAX to my controller but they do not reach me. I have looked at some web pages but I have not found the solution to this problem.
In the jQuery tag:
function add_tipoDoc() {
var idTi = document.getElementById("tipoDocumental.idTipoDocumental").value;
var capa = document.getElementById("divlistar");
$.ajax({
type: "get",
dataType: 'text',
url: "select_tipodoc.htm",
data: {
'valorP': idTi
},
success: function(response) {
var z = JSON.parse(response);
$("#tableindice").find("tr").remove();
for (var i = 0; i < z.length; i++) {
var htfil = "<hr/><tr>";
var htcol1 = "<td>" + "<label name='nombres' for='normal' class='control-label'>" + z[i] + "</label></td>";
var htcol2 = "<td>" + "<input name='valores' type='text' cssClass='form-control' placeholder='Ingrese Valor'/></td>";
var htfil2 = "</tr>";
var htfin = htfil + htcol1 + htcol2 + htfil2;
$('#tableindice').append(htfin);
}
},
//...
In the HTML:
<div id="divlistar">
<table id="tableindice">
</table>
</div>