Home Forums Front-end Issues Ajax font-end save stopped working? Reply To: Ajax font-end save stopped working?

  • Hey John, I was able to solve this by moving the ajax save completely into my own function. Here is the function in case anyone finds this later:

    $('.acf-form').on('submit', function(e){
    		// define the form data
    		let $form = $(;
    		// submit the form
    			url: window.location.href,
    			method: 'post',
    			data: $form.serialize(),
    			success: function(data) {
    					$(" i").removeClass('fa-spinner');
    					$(" i").addClass('fa-thumbs-up');
    						$(" i").removeClass('fa-thumbs-up');
    						$(" i").addClass('fa-save');
    					}, 3000);	
    		console.log("form submit 1");

    I don’t know why it stopped working. Something about the e.preventDefault() stopping this:

    acf.add_action('submit', function($form){
        // old ajax code was in here