You put your value
JS variable that you created in the data that gets sent to your php function via ajax like:
var data = {
'action': 'get_etim',
'whatever': ajax_object.we_value,
'select_value': value
};
Then in the php function that Ajax sends to you can use select_value
the same way you used whatever
in your code like:
echo “Whatever is: “ . $_POST[‘whatever’] . “, and Select value is: “ . $_POST[‘select_value’];
Don’t forget to use a nonce, sanitize input data, and escape output.
Related Posts:
- Do I require the use of nonce?
- Problem with WordPress Ajax form
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- How to test nonce with AJAX – Plugin development
- WordPress ajax doesn’t display object method on jQuery .change() function
- adjust section according to country?
- Execute Jquery when a specific page in my plugin is loading
- Input field duplicates on form submit by jQuery
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- getJSON response to PHP
- ajax problems on loading page [closed]
- ajaxurl not defined on front end
- How can I fetch loop of post titles via AJAX?
- Retrieve POST data from AJAX call
- Security – Ajax and Nonce use [closed]
- Looking for a better way to handle an ajax script that pulls in post data on click
- Can’t use get_results() in ajax query
- Admin-ajax.php appending a status code to ajax response
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Passing jQuery value using Ajax to a page template
- How to set a custom path, for ajax image upload folder in admin?
- admin-ajax.php responding with 0
- ajax_object is not defined when ajax calls the function
- How to speed up admin-ajax.php in wordpress
- Page Reloads Before AJAX Request Finishes
- Why is this Ajax not working?
- Use ajax from function.php
- Ajax return code 400
- Create onClick Event to Re-load a Widget
- How to select the contents in the text view textrea in wp_editor?
- ajax, right way to do it and make it works?
- Ajax loaded form replaces form action with Ajax url
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- Ajax date_query not working past the first iteration
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- AJAX pagination, update current page
- How to add a do_action on refreshing of WP customizer?
- Setting value of session with Ajax not working
- [jQuery]Adding shortcode
- Display parent and child taxonomies in separate drop down select fields
- Show success or error messages in Ajax response to WordPress custom registration form
- how to update and display an option without reloading the page
- WordPress admin-ajax.php 400 bad request
- Ajax contact form return 0
- AJAX – Returning Two JSON Objects with One PHP Function
- Pull GetOption() variable into jQuery dynamically created html
- Add Ajax Hooks and Call from Custom Template PHP
- WordPress Ajax Always returning 0
- Problem with AJAX in wordpress plugin
- Double jQuery loaded
- How to keep track of when a vote is cast?
- My jQuery Ajax form submit is still refreshing page?
- Ajax search shows all results when user empties input?
- Why i can’t get custom fields value or post ID via Ajax?
- Output votes to div dynamically in wordpress
- Get uploaded image and attach it to the new post
- Admin-ajax php not working on new wordpress version
- Proper way to use WordPress function with AJAX PHP file
- Live search from database table
- Add a counter for mouseovers (custom field)
- Accessing an API with jQuery and AJAX
- Removed jQuery script from header.php , any problems?
- calling admin-ajax.php from admin-ajax.php
- How to set variables with AJAX request to use in another function in WordPress
- Search Ajax Call – Use Form Data in Response
- Why does PHP called with Jquery AJAX not allow additional php code to be added?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Database entry removed on browser refresh, Ajax PHP jQuery
- Is it possible to access admin-ajax.php using PHP?
- How do I call a value from the datase using ajax
- Post form – AJAX won’t upload featured image – Plugin development
- Ajax result show in console if is called outside function and not showing in array
- Where to add my PHP codes for AJAX Jquery to work?
- How to change PHP variables with AJAX request in WordPress
- How to use wp_ajax_set_post_thumbnail?
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- 400 bad request admin-ajax file upload
- Can’t make lazy load for my site, help!
- How to reload a php script, using AJAX and jQuery
- wp_ajax_ 400 Bad Request
- Load script and styles using an array of resources
- update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
- How to echo a PHP code into WooCommerce variation product?
- How to call a function from functions.php with ajax?
- Custom theme admin-ajax.php 400 (Bad Request)
- Ajax in a class instantiated via shortcode
- number of posts with “Load More”
- Find the method which AJAX GET calls
- Ajax not updating to database
- Ajax Load more CPT via shortcode
- ajax form with multiple submit buttons and values
- How to run ajax in WordPress Post?
- Add php function into .js file (for tinyMCE button)
- Why this plugin is not working?
- Adding javascript files to WordPress and jQuery version
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- ajax form function error
- Load Meta box value into div AJAX [duplicate]
- Upload multiple files via ajax from an HTML file input