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
- jQuery AJAX submit form
- JavaScript implementation of Gzip
- 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
- 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
- Custom PHP endpoint for a plugin’s AJAX call
- 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
- Is there a hook that fires before an ajax call?
- Drag and drop multiple file upload using Ajax WordPress
- Vue.js + AJAX Shortcode
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- wp_ajax action is not running
- Confused on AJAX submit form through page template
- 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
- 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]
- WordPress Ajax Problems
- Woocommerce Ajax Add cart not working
- Using AJAX with Forms
- Show Post Content with AJAX
- Load JavaScript from a post that’s loading into Fancybox via ajax
- How do I query posts by a sub value with the API?
- contact form ajax empty response error message
- Gravity Forms closes my popup on Validation Error [closed]
- 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?
- 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
- How to create a form button that executes a function?
- 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
- Ajax page load without reload
- Load page HTML content through AJAX
- change wordpress pagination url after doing the request
- Get localize of a loaded javascript
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- How to send automatic response after form submission without plugin
- Set cors header for ajax requests
- Is there a hook that fires after an ajax call?
- How to Object.freeze wp_localize_script
- How to pass value from ajax to php in no conflict mode?
- Content including hooks inside wp-settings.php are being called twice in WordPress
- Opening Modal popup on Ajax form submission
- Ajax sometimes work and sometimes just don’t work
- React to AJAX adding to the page
- Hook after all metadata are set is triggering several time
- Download doccument on server rather than clients browser
- Issue developing an AJAX form with WordPress
- Javascript output now showing in custom widget
- Ajax call on class returns old data
- Create a post with REST API and adding a category
- Get post details with pure javascript ajax
- How to submit form data in the same page in WordPress without reloading the page?
- Why function called by admin-ajax executes synchronously?
- Jquery wrap permalink in a data-attribute?
- Using AJAX on Contact-form the WordPress way
- Error while submitting form using AJAX and php
- Ajax contact form returnig 0
- Trying to send AJAX data to WordPress hook
- Ajax Form data is not posted back to the get_results()
- Using AJAX for dynamic settings pages
- ‘Dehighlighting’ navigation once clicked
- How do I convince this button to do something when it is clicked?
- Why wp_ajax hooks doesn’t work?
- AJAX admin Internal 500 error Failed to Upload
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- How to get current_user_id from wordpress in node js?
- AJAX call not initializing for non-admins in WordPress
- WordPress REST API FormData: Form Not Submitted When No Files Attached
- JQuery UI Autocomplete/Autosuggest WordPress
- How to show custom fields in modal in category page