T
T
tea_pot2020-04-06 23:02:20
JavaScript
tea_pot, 2020-04-06 23:02:20

How to store value in cookie?

I have a form processing script

$(document).ready(function() {
    $("#form").submit(function() {
        let count = $('#number');
        $.ajax({
            type: "POST",
            url: "order.php",
            data: $(this).serialize()
        }).done(function() {
            count.val(parseInt(count.val())-1);
            $("#form").trigger("reset");
        });
        return false;
    });
});


Near the form there is a counter of free places. And there is a function that, upon successful sending, decrements the counter value by 1

let count = $('#number');
count.val(parseInt(count.val())-1);


Please tell me how can I store the #number value for the user who submitted the form. So that he sees the value #number - 1

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question