Settings API form – submit with AJAX

I just tested your code, I guess the ajaxurl in your javascript is wrong, it must be: <?php echo admin_url( ‘options.php’ ); ?> This is the code I have tested. class TestAjaxSettingsAPI { public function __construct() { add_action( ‘admin_menu’, array( $this, ‘agy_admin_menu’ ) ); add_action( ‘admin_init’, array( $this, ‘agy_register_settings’) ); } public function agy_admin_menu() { … Read more

Passing value from select form with Ajax not working

You seem to be missing the ajax actions, there are two, one for logged in users and one for not logged in users. Going by your action you will need to add the following actions. // this one for logged in users add_action(‘wp_ajax_my_action’, ‘my_action’); // this one for not logged in users add_action(‘wp_ajax_nopriv_my_action’, ‘my_action’);