How to use the .each function in Ajax

1

I'm trying to show several response results. Follow up, check a little and I found out that it's with .each to show me everything about that field, this is my code ..

function Tcaso(id){ 
			$.ajax({
				type:"POST",
				data:{'id':id},
				dataType:'json',
				url: uri + "/caso/mostrarCasos",
			}).done(function(respuesta){
				$("#id").val(respuesta.id);
				console.log(id);
				$("#idcliente").val(respuesta.idcliente);
				$("#ncuentaca").val(respuesta.ncuenta);
				$("#nombreca").val(respuesta.nombre);
				$("#direccionca").val(respuesta.direccion);
				$("#telefonoca").val(respuesta.telefono);
				$("#ciudadca").val(respuesta.ciudad);
				$("#nombredecca").val(respuesta.nombredec);
                $("#fallaca").val(respuesta.falla);
                $("#descripcionca").val(respuesta.descripcion);
                $("#resca").val(respuesta.responsable);
                $("#fecca").val(respuesta.fecha);
                $("#estadoca").val(respuesta.estado);
                $("#solucionado").val(respuesta.solucion);
                $("#idseguimiento").val(respuesta.idseguimiento);
                $("#seguirme").val(respuesta.seguimiento);

				$("#modalT").modal();

				
		
			});
		}

I want to do a .each to show me everything that has field so that at the moment it shows me only one field

You should show me examplito and big bank

      <textarea type="textarea"  name="seguirme" id="seguirme"></textarea>

            <input type="text" name="idseguimiento" id="idseguimiento">

This is the query to show Cases

SELECT c.id, c.falla, c.responsable,  c.fecha ,c.descripcion  , c.solucion , c.estado , l.idcliente , l.nombre , l.ncuenta , l.nombredec , l.ciudad , l.direccion , l.telefono , s.idseguimiento , s.seguimiento FROM caso c join cliente l on c.idcliente=l.idcliente join seguimiento s on c.id=s.idcaso where id = :id

I should show the two "follow-ups" of case 1 in the modal ..

I'm trying with this code and it only sends me a value.

$.each([respuesta.seguimiento], function( index, value ) {
                alert( index + ": " + value );
                
                     });

    
asked by JOHAN ALEXIS MORENO GUISAO 13.07.2018 в 15:34
source

0 answers