You are not giving the action name to your AJAX call. In WordPress, you have to give an action name, the same name you give whatever is after wp_ajax_ and wp_ajax_nopriv_
In this case, the AJAX call should work if you change the data: inside your AJAX call, for this:
data: {action: "contactform_action", values: $('#contact-form').serialize()}
Then retrieve the values of the form with $_POST["values"];
in your php function.
Related Posts:
- ASP.NET MVC controller actions that return JSON or partial html
- How to cache json with wp-super cache
- Why use wp_send_json() over echo json_encode()?
- WordPress function that makes HTML safe to be sent via AJAX request
- WP REST API route request explain
- How to use wp_send_json_error?
- Most performant way of fetching remote API data?
- json encode not work in wordpress
- Unable to parse JSON response from wp_send_json_success [closed]
- WordPress ajax success response
- Ajax store response json in variables
- How do I query posts by a sub value with the API?
- contact form ajax empty response error message
- Cache wp-json/posts without a plugin?
- Wp mail does not work when Ajaxed to
- wp_mail 200 response but no mail sent
- merge wp rest api query to get posts per category does not work
- Retrieve JSON file from JS trough php
- Upload data from weather station to WordPress Website
- Sql formatting for post data within function
- wp_mail doesn’t work when logged in?
- How can I wp_send_json data?
- Full Front End, AJAX comment system and comment reply script
- Send checkbox status with Ajax / JSON and save it
- Chained ajax call, second call returns 0
- Contact form – ajax, wp_mail
- Display full WordPress post under search form using AJAX
- Add Server Side validation in Ajax mail form
- How to send automatic response after form submission without plugin
- Sending email through Ajax without page refresh hangs on admin_ajax.php
- Can I use application/json content type in WordPress
- Using wp_send_json_success instead of $result[‘message’], die, etc
- AJAX POST Value not being returned – WordPress – AutoTrader API
- Ajax call works for logged in users and returns “Bad Request” for guests [duplicate]
- How to inject data content from external json into a modal, using UIkit?
- How to send the checkbox value to email
- how to correctly use json_encode with ajax
- WorddPress website admin part not working correctly – I think ajax/json issue
- 403 error for ajax POST request
- Ajax WordPress pass post URLs
- How to populate data from JSON using AJAX in TypeScript? [closed]
- Sending email with wp_email and AJAX
- Ajax contact form returnig 0
- AJAX Call in Plugin Returns More than JSON
- Usage of wp_send_json_success and wp_redirect at the same time
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- Ajax in a settings page (update_option is undefined)
- admin-ajax.php vs Custom Page Template for Ajax Requests
- AJAX request from Chrome Extension to WordPress Website
- How to correctly load wordpress in a non WP script for AJAX request
- Why is admin ajax reloading my page
- CPU usage: AJAX and Heartbeat API on admin pages
- Retrieving JSON data in ajax request from media uploader
- Solve cors problem using rest api or ajax
- Can part of my WordPress website be headless?
- Nonces, AJAX, script variables & security in WordPress
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- Why would admin-ajax.php redirect to the home page for logged out users?
- Admin Ajax and HTML5 Formdata
- Implementing an AJAX POST API call in wordpress
- Ajax WordPress Login needs to be stayed in current page Url without redirecting
- Creating a Multi-Level Associative Object Using AJAX
- Loading comments in ajax – comment-reply function missing $args
- Woocommerce update product price via AJAX
- Popup or admin/update notice on post/page edit screen without page refresh
- Enqueue script in plugin is not working
- Single page site + pushState?
- wp_mail works with add_action(‘save_post’, …) but not an ajax action
- Ajax call does not work for this simple code
- WordPress ajax call returns a zero though die()
- Localize script not working
- Why, if a function accepts arguments, it fails on ajax calls?
- WP_query offset seems to be counting draft post – AJAX load more
- adding ajax load more to display images from meta box
- Can’t load search results with ajax
- wp_ajax is not calling the action
- Deny dashboard access breaks ajax requests
- Run javascript upon successfully set featured image
- update_option in WordPress AJAX
- ajax in admin menu
- Register Template
- WordPress responds to the ajax request with readyState 1, 2, 3 before responding with 4
- Filter images from media library by guid meta field
- Counting Posts with multiple taxonomy and terms condition using MySQL and AJAX
- WordPress New Post via ajax call
- 400 Bad Request getting on AJAX Call
- How to add Ajax to this Pagination i made?
- Adding user using admin ajax by a user with custom role
- How can I run two AJAX requests simultaneously in WordPress?
- Issue developing an AJAX form with WordPress
- WP admin ajax Pagination issue
- Why function called by admin-ajax executes synchronously?
- Using AJAX for dynamic settings pages
- AJAX admin Internal 500 error Failed to Upload
- Class property not visible inside ajax callback function?
- WordPress Custom wp mail template return full template
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- Use Ajax to get an Options Settings Value
- How to get variable from other function inside class function using add_action for Ajax call