The problem is that there are two copies of the project. Local and production. In the local, this form successfully sends everything and the information is processed, on the production it gives an error that the form is not connected. Form declaration
function addDeleteForms() { $('[data-method]').append(function () { if (! $(this).find('form').length > 0) { return "\n" + "<div class='frm' data-action='" + $(this).attr('href') + "' data-name='" + $(this).attr('name') + "' style='display:none'" + " data-method='" + $(this).attr('data-method') + "' data-token='" + $('meta[name="_token"]').attr('content') + "'></div>\n"; } else { return ""; } }) .removeAttr('href') .attr('style', 'cursor:pointer;') .attr('onclick', 'submitFRM($(this).find(".frm"));'); //.attr('onclick', '$(this).find("form").send()'); } Call handler
addDeleteForms(); /** * Generic confirm form delete using Sweet Alert */ $(document).on('submit', 'form[name=delete_perm],form[name=delete_item]', function(e){ e.preventDefault(); var form = this; /*title: "Warning", text: "Are you sure you want to delete this item?", type: "warning", confirmButtonText: "Yes, delete it!",*/ if($(form).attr('name')=='delete_perm' || $(form).attr('name')=='delete_item'){ swal({ title: "Предупреждение", text: "Вы уверены, что хотите удалить этот элемент?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Да, удалить его!", cancelButtonText: "Отменить", closeOnConfirm: true }, function(confirmed) { if (confirmed) form.submit(); }); }else{ form.submit(); } }); Well, actually adding these same buttons to the plate in which information is displayed.
$('body').delegate('#<?=$grid->getConfig()->getName()?> .pagination a','click',function(e){ e.preventDefault(); var parent_form=$(this).parents('form'), key=parent_form.find('div.keys'), url=$(this).attr('href'), param=parent_form.serializeArray(); $.each(param,function(i,val){ var myRe = /<?=$grid->getConfig()->getName()?>\[page\]/ig; var myArray = myRe.exec(val['name']); if(myArray){ delete param[i] } }) var gets=$.param(param); url=url+'&'+gets; key.prop('title',url); $.fn.yiiGridView.update('<?=$grid->getConfig()->getName()?>'); setTimeout( function(){ addDeleteForms() },2000); }); Lord, in which direction to dig? I already as soon as I could and compared the page codes - identical except for the address of the appeal (which is logical). Why does the same code on the local server work, and on the external one it gives "Form submission canceled because the form is not connected"?