Variable PHP:
<?php $course_details_url_back = site_url("home/lesson/".slugify($course_details['title'])."/".$course_id); ?>script hacer acción para el formulario:
$(document).on('submit','#form_create_user',function(e){ e.preventDefault(); var fd = new FormData(this); var obj = $(this); fd.append('course_id', "<?php echo $this->uri->segment(4); ?>"); obj.find('input[type="submit"]').val("Tworzenie...") $.ajax({ url: $(this).attr("action"), data: fd, cache: false, processData: false, contentType: false, type: 'POST', success: function (dataofconfirm) { // do something with the result // obj.find('input[type="submit"]').val("Confirm user") } }); $.ajax({ url: "<?php echo site_url('home/saveValues/'); ?>", data: fd, cache: false, processData: false, contentType: false, type: 'POST', success: function (dataofconfirm) { // do something with the result toastr.success("Success created user."); obj.find('input[type="submit"]').val("Potwierdź") } }); })Después de enviar el formulario, necesito realizar las acciones anteriores y también debo implementar la página de actualización del código anterior en el formulario de envío y volver a la URL.
Para esto tengo un código separado:
document.getElementById("form_create_user").onsubmit = function(){ window.location.replace("<?php echo $course_details_url_back; ?>"); }Pero, ¿alguien puede ayudarme a implementar esto en el código actual?