give a value to input when move then save it by ajax - php / jquery -php
<p>I want to create a shopping cart and i'm almost finish. I use ajax for dynamic search and ajax for add to cart and use jquery for refresh a specific div when click but i face a problem.My problem is Quantity problem. I use session for store value 
//this is my session update code</p>

<pre><code>$con = mysqli_connect("localhost", "root" , "","atest");
session_start();
    require("functions.php");
    cart_session();
$id=$_POST['id'];
        //echo $arr['cart'];

        if(isset($_SESSION[$arr["cart"]][$id])){

            $_SESSION[$arr["cart"]][$id][$arr["quantity"]]++;
            //redirect("http://localhost/my/work/sellingcart/index.php",true);

        }else{

            $sql_s="SELECT * FROM product_1
                WHERE p_id={$id}";
            //echo $sql_s;
            $query_s=mysqli_query($con,$sql_s);
            if(mysqli_num_rows($query_s)!=0){
                $row_s=mysqli_fetch_array($query_s);

                $_SESSION[$arr['cart']][$row_s["p_id"]]=array(
            "{$arr["quantity"]}" =&gt; 1
                    );

                //redirect("http://localhost/my/work/sellingcart/index.php",true);
            }else{

                $message="This product id it's invalid!";

            }

        }
</code></pre>

<p>//use ajax for update cart</p>

<pre><code> &lt;script&gt;     
      $("#link").click(function(e) {
  e.preventDefault();
  var id = $("#id").val(); 

  var dataString = 'id='+id;
    $('#loading-image').show();
$(".form :input").attr("disabled", true);
$('#remove_cart').hide();
$('#link').hide();
 $(".container").css({"opacity":".3"}); 


$(".form :input").attr("disabled", true);
$('#remove_cart').hide();
$('#link').hide();
  $.ajax({
    type:'POST',
    data:dataString,
    url:'add_cart.php',
    success:function(data) {
      $('#availability').html(data);  
    },
    complete: function(){
        $('#loading-image').hide();
        $(".form :input").attr("disabled", false);
        $('#remove_cart').show();
        $('#link').show();
        $(".container").css({"opacity":"1"}); 


    }
  });
//$("#chat").load(location.href + " #chat");
//$("#chat").load(location.href+" #chat&gt;*","");
});


 &lt;/script&gt;
</code></pre>

<p><a href="https://i.stack.imgur.com/LzQ6c.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LzQ6c.jpg" alt="enter image description here"></a>
Here is image and Red mark is my problem. </p>

<p>i want to update my cart when i give value and move it then it update my session by ajax and php.</p>

<p>Is there any help? I don't want to user can update there quantity every cart item singly. i want it dynamic just give quantity number and move then it save by ajax. </p>