Pass form attributes to another php template in wordpress

It looks like you have read thru the WP Codex, so you have basically set things up right. A couple little things I would suggest:

Make sure the URL var is correct

You are using sliderData.adminAjax to point to the AJAX URL. I have always been able to simply use ajaxurl because WP defines it for me. I would make the switch to make sure you are hitting the right target. (It’s always possible your sliderData object is not in scope, or the member variable didn’t get set correctly.)

Fix PHP file

In the function doctor_search_process(), you try to access the POST variable as if it’s a two-dimensional array. I’ve never seen an example that suggests this. It’s always worked for me to access the POST var I want directly. I think you should try:

$g = $_POST[ 'gender' ];

But then you should echo it back.

function doctor_search_process() {
    $g = $_POST[ 'gender' ];
    echo $g;
    wp_die();
}

I have read on this forum that if the PHP file doesn’t “die()” then AJAX will not the process has finished.

Improve javascript

I really like the way you pass the AJAX action into the javascript function that initiates the AJAX. However, you don’t seem to be concluding the AJAX call correctly. In your success function, you are catching both success and failure. Generally, failure is caught by its own function. Also, the success function always comes first, so it doesn’t have to be explicit. This is what works for me:

$.post(
  data: {
     action: action,
     data: formData
  },
  function( content ) {
     alert( content );
  } ).fail( function( ) {
    alert( "you suck" );
});