why ajax not work in this code In callback of custom  menu  wrote function , in function I want to use node_add ,
I have a field that I want add AJAX to it, but when change the  field nothing happened 
where is the problem?
I am using Drupal 7

 module_load_include('inc', 'node', 'node.pages');
    $form = node_add('pre_register');
$form['field_course_display_ref']['und']['#value'][]=$nid;
    $form['field_course_display_ref']['#ajax'] = array(
      'callback' =&gt; 'myfunction_ajax_change_course',
      'event' =&gt; 'change',
      'wrapper' =&gt; 'course-schedules-div',
      'method' =&gt; 'replace',
      'effect' =&gt; 'fade',
    );
    $form['field_course_schedules']['#prefix'] = '&lt;div id="course-schedules-div"&gt;';
    $form['field_course_schedules']['#suffix'] = '&lt;/div&gt;';


I also try 

 module_load_include('inc', 'node', 'node.pages');
    $form = node_add('pre_register');
$form['field_course_display_ref']['und']['#value'][]=$nid;
    $form['field_course_display_ref']['und']['#ajax'] = array(
      'callback' =&gt; 'myfunction_ajax_change_course',
      'event' =&gt; 'change',
      'wrapper' =&gt; 'course-schedules-div',
      'method' =&gt; 'replace',
      'effect' =&gt; 'fade',
    );
    $form['field_course_schedules']['#prefix'] = '&lt;div id="course-schedules-div"&gt;';
    $form['field_course_schedules']['#suffix'] = '&lt;/div&gt;';


but nothing happened :(

EDITED I have two field, one field_course_schedules (will wrap) and field_course_display_ref The field that I want but changing it ajax will be trigger.

type mistaked in code corrected but not worked again
You're trying to modify a form which is already got built/processed!!

node_add function is internally calling drupal_get_form which will return the processed form, so even if you change anything it wont take any effect. i.e. Drupal will consider the things which are available when the form is being built/processed.

To overcome this you should use drupal_retrive_form instead of drupal_get_form.

The same problem is discussed here with different context, sadly the OP took part in that discussion :(