You can change the form action to admin-ajax.php?action=your_action and this will work, but it’s not best practice.
The ajax submition should be added via javascript, not by changing the form action (also your js function should prevent the form from submiting normally, returning false – see here an example: http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/), and php handling of the data (on the page the form action is poing to) should be present as fallback.
Related Posts:
- How to HTML5 FormData Ajax
- Admin Ajax and HTML5 Formdata
- How to display contact form 7 form in vanilla js without jquery in frontend
- Refresh Gutenberg with JS for it show updated post
- Ajax show custom post data form & script
- Bad Request when adding new post via ajax form
- How to make Contact Form 7 work when injected via AJAX in WordPress?
- Send POST data using XMLHttpRequest
- jQuery AJAX submit form
- JavaScript implementation of Gzip
- FormData append not working
- jQuery’s .on() method combined with the submit event
- Is there a JavaScript API? How to access public and private data in JS?
- Nonces and Cache
- admin-ajax.php doesn’t work when using POST data and Axios
- Contact Form 7 Custom Post Action
- Custom Form with Ajax
- ajax – why multiple calls to wp_create_nonce() return same value?
- Admin Notification after save_post, when ajax saving in gutenberg
- How to properly use wp.ajax.post?
- Custom PHP endpoint for a plugin’s AJAX call
- Detecting post type within init action
- How to link WordPress heartbeat to ajax form
- Refused to execute script from ‘***’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled
- WordPress Ajax Login without page reload
- Ajax form submission from admin panel
- wp_ajax_[service] returning 0
- Is there a hook that fires before an ajax call?
- Dynamically changing navigation links (next and previous) via AJAX
- Drag and drop multiple file upload using Ajax WordPress
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Quick Edit: Selected Custom Taxonomy Not Refreshing After Save
- Vue.js + AJAX Shortcode
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- wp_ajax action is not running
- fetching via fetch/ajax gutenberg block data from third party
- Confused on AJAX submit form through page template
- Using wp_ajax and wp_ajax_nopriv hooks
- ajax and nonce when JavaScript is in a seperate file
- how to use reCaptcha v3 in wordpress custom login form?
- admin-ajax.php HTTP400: BAD REQUEST – The request could not be processed by the server due to invalid syntax
- Conditional action hooks
- Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
- AJAX issue – Uncaught SyntaxError when processing Zip File
- WordPress AJAX Call Not Return Result
- Is there a hook to process a backbone restful PUT request inside wordpress?
- Nonces, AJAX, script variables & security in WordPress
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- How to localized one js file for different actions?
- Prevent page reload after ajax form submission
- wp-admin AJAX with Fetch API is done without user
- submitting form via admin-ajax.php returns 0
- Can I fire an add_action hook inside of a function that recieves data via wp_ajax?
- Call javascript function when category was added via ajax
- Populating content dynamically via AJAX and Advanced Custom Fields [closed]
- Help with AJAX front end comment moderation
- WordPress Ajax Problems
- jQuery Ajax passing empty parameters to my function?
- Woocommerce Ajax Add cart not working
- Using ajax with wordpress
- Using AJAX with Forms
- Ajax Modal Flickers When Opened Multiple Times
- Ajax image upload with media_handle_upload and form.js
- Show Post Content with AJAX
- Load JavaScript from a post that’s loading into Fancybox via ajax
- splitting the URL using jQuery
- AJAX Load more on CPT returning random posts
- Ajax post returning full html page as response
- Which allowed API hooks work to add wp_ajax action?
- Refresh Markercluster after ajax call
- Sending variable from ajax on form submit
- Making an ajax request from a different domain
- Performance optimization of tree like structure
- How do I query posts by a sub value with the API?
- contact form ajax empty response error message
- Radio buttons live refresh in the customizer
- Gravity Forms closes my popup on Validation Error [closed]
- How do I pass the id of my widget to javascript in the form function?
- Can’t trigger an AJAX function with a submit button in the dashboard
- Dynamically add more fields/remove last field in a form
- Ajaxify Form That Submits To Same Page To Display Post Data [closed]
- Why is wp_localize_script returning false?
- Specify ABSPATH in jQuery url
- ajax form is returning the dreaded “[HTTP/1.1 400 Bad Request” and a zero
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- ajax problem – function on server is not called
- wp_mail doesn’t work when logged in?
- Hide Load more Ajax button if there is no more users to load or less than the number?
- How to disable drag-and-drop upload function in Media Library?
- javascript ajax and nonce
- Output multi-steps form results in same page
- Making POST request with AJAX returns a 400 error (without jQuery)
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Using get_theme_mod in php ajax form doesn’t work
- How to create a form button that executes a function?
- Is there a better way to access transients using javascript
- How to stop being directed to admin.php after sending request to admin-ajax.php
- Run javascript upon successfully set featured image
- admin-ajax.php (aborted) error when using jQuery.get
- Replace link with form to pass variables to javascript / ajax