javascript - How to disable form (user cannot checked, fill text , select dropdown etc.) in this form when process requests post ajax? -
how disable form (user cannot checked, fill text , select drop down etc.) in form when process requests post ajax ?
i want disable form id="f1"
when process send post ajax , how can ?
<script> function send_requests_data(){ $('#demoajax').hide(); $('#loading').show(); $.ajax({ url: 'test.php', type: 'post', data: $('#f1').serialize(), success: function(data){ $("#loading").fadeout("slow"); $('#demoajax').show(); $('#demoajax').html(data); } }); return false; } // on load page call function code // $(document).ready(send_requests_data()); </script>
a possible answer may found here: disable form elements inside div
tl;dr try adding this:
$("#parent-selector :input").attr("disabled", true);
to ajax call parent-selector either div or form id.
Comments
Post a Comment