Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

428
Visualizações
How to get ajax response values from different ajax request response? or any other way?

I have a form having dependent drop down list like brands, category and product and for single row I am having all 3 list from 3 ajax request response but in new row using addrow how I can call or get 3 different ajax response value under one?

for example based on brand category comes like

$.ajax({
        url: 'php_action/fetchDropdownProductData.php',  // category depend on brand name
        type: 'post',
        data: {brandId : brandId},
        dataType: 'json',
        success:function(response) {
            var html = '<option value="">Select Category</option>';
            response.forEach(category => {
                 html += "<option value='" + category.categories_id + "'>"+ category.categories_name +"</option>"
                 $("#productCategories"+row).html(html);
            })
        } // /success
    }); // /ajax function to fetch the product data

and for addrow ajax

$.ajax({
        url: 'php_action/fetchProductData.php',
        type: 'post',
        dataType: 'json',
        success:function(response) {
            $("#addRowBtn").button("reset");            

            var tr = '<tr id="row'+count+'" class="'+arrayNumber+'">'+
                 // start of productBands on addrows                
                '<td>'+
                    '<div class="form-group">'+
                     // here is the wrong I am doing...
                    '<select class="form-control" name="productBrand[]" id="productBrand'+count+'" onchange="getProductData1('+count+')" >'+
                        '<option value="">~~SELECT~~</option>';

            $.each(response, function(index, value) {
                tr += '<option value="'+value[0]+'">'+value[1]+'</option>';                         
            });
                                                    
            tr += '</select>'+
                '</div>'+
            '</td>'+
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda