在数组中调用ajax响应的正确方法

i have this ajax call

    $.ajax({
    type: 'POST',
    url: "<?php echo $_SERVER_ADDR . PUBLIC_PATH . 'presupuestos/buscant/'; ?>",
    data: { 'arregloid':sel_articulos, 'idpre':$('#presupuestos_id').val()},
    dataType: "json",
    success: function(responses) {
        $.each(responses, function(ii, response) {              
            $("[name='#pre_detalle["+response["idart"]+"[canart]]']").val(response['canart']);
            $("#pre_detalle_precio["+response["idart"]+"]").val(response["precio"]);            
            console.log(response["idart"]);
            console.log(response["canart"]);
            console.log(response["precio"]);
        });
    },
    complete: function () {
        $('#spinner').hide();
        actTotales();
    },
    error: function() {
    }
    });//ajax 2 

i need to assign to 2 text inputs with ids:

id="pre_detalle_precio[x]" and id="pre_detalle_[x][canart]

being x the article id being returned by the ajax this three responses:

response["idart"];
response["canart"];
response["precio"];

i can see the responses being returned correctly with console.log but can't alter the values of the input boxes.

i think you are missing underscore

$("[name='#pre_detalle_["+response["idart"]+"[canart]]']").val(response['canart']);
            $("#pre_detalle_precio_["+response["idart"]+"]").val(response["precio"]);    

as in id="pre_detalle_precio[x]" and id="pre_detalle_[x][canart]

try now