Chciałem zrobić prosty formularz bez przeładowania strony za pomocą serialize i wszystko działa OK, ale po wywołaniu skryptu nie przekazuje zmiennej Submit POST -> $_POST['unpublished'] i $_POST['published']
Jeżeli formularz ładuję bezpośrednio z products_success.php te zmienne istnieją i warunki mogą być spełnione.
Problem mam taki jak zrobić żeby te zmienne POST po wywołaniu serialize też istniały?
<script> $(document).ready(function(){ $("#form_add_products").on("submit", function(event){ event.preventDefault(); $.post("products_success.php", $(this).serialize(), function(data){ }); }); }); </script> <form id="form_add_products" method="post" enctype="multipart/form-data"> .... <input type="submit" name="published" value="Opublikuj" class="dropdown-item"> <input type="submit" name="unpublished" value="Wycofaj" class="dropdown-item"> </form>
} }