Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138134

How to split ajax result

$
0
0
$("select#product-id").change(function(){
    $("input#product-name").val("Loading...");
    var value = $(this).val();
    $.ajax({
        url: "http://localhost/api/purchase-entry-data.php",
        data: {
            product_id : value
        },
        type: "POST",
        success: function(data){
            $("input#product-name").val(data);
        },
        error: function (){
            $("input#product-name").val("No Data Available");
        }
    });
});

I am tring to use ajax result in two places (there is two value in the ajax result 1. Product Name, 2. Product Size).
So how to split up that that result in two different values in php.


Viewing all articles
Browse latest Browse all 138134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>