mercredi 15 janvier 2020

how to refresh the form in jquery after ajax response [duplicate]

how do I delete all the contents of the fields in the form, if I use ajax to post to the controller

    <form id="addform">

     $("#btnadd").on("click",function(){
    $(this).attr('disabled','disabled');
        var tampung = $("#addform").serialize();
        $.ajax({
               type: "POST",
               url: "",
               data: tampung,
               dataType: "json",
               success: function(response) {
                if(response.validator == 'error'){
                    $("#btnadd").removeAttr('disabled');
                }
                if(response.status){
                    createAlert(response.status, "success");
                    $(".close").trigger('click');
                    $("#btnadd").removeAttr('disabled');
//there i need refresh form
                    VendorClient.ajax.reload(null, false);
                }
        });
   });


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38a9bFx
via IFTTT

Aucun commentaire:

Enregistrer un commentaire