Edit: For what it's worth, this is the module that the "use-ajax" link calls but I don't think it matters much.
<?php function custom_ajax_page_st_form_form_init() { drupal_add_js('misc/jquery.form.js'); drupal_add_library('system', 'drupal.ajax'); } /** * Implements hook_menu(). */ function custom_ajax_page_st_form_menu() { // A menu callback is required when using ajax outside of the Form API. $items['class-content-form'] = array( 'page callback' => 'ajax_content_response', // 'access callback' => 'user_access', 'access arguments' => array( 'access content' ), 'type' => MENU_CALLBACK ); return $items; } function ajax_content_response($type = 'ajax', $nid = 0, $node_type = "", $home_nid) { $output = _custom_page_st_form_loader(); if ($type == 'ajax') { $commands = array(); $commands[] = ajax_command_replace('#class_form_load', '<div id="class_form_load">' . $output . '</div>'); // $commands[] = ajax_command_invoke('.add_menu', 'show'); // Remove Spinner $commands[] = ajax_command_invoke('html', 'trigger', array( 'remove_ajax_spinner' )); // Set Groups Audience if ($nid != 0) { $commands[] = ajax_command_invoke('#edit-og-group-ref-und-0-default', 'val', array( $nid )); $commands[] = ajax_command_invoke('#edit-og-group-ref-und-0-default', 'trigger', array( "chosen:updated" )); } // Set Home if ($nid != 0) { if ($node_type == "homepage_group") { $commands[] = ajax_command_invoke('.form-item-field-home-und input', 'prop', array( "checked", true )); } // $(".form-item-field-home-und input").prop("checked", true) } // Set Homepage Audience $commands[] = ajax_command_invoke('#edit-field-homepage-audience-und-0-default', 'val', array( $home_nid )); $commands[] = ajax_command_invoke('#edit-field-homepage-audience-und-0-default', 'trigger', array( "chosen:updated" )); $page = array( '#type' => 'ajax', '#commands' => $commands ); ajax_deliver($page); } else { $output = '<div id="class_form_load">' . $output . '</div>'; return $output; } } function _custom_page_st_form_loader() { module_load_include('inc', 'node', 'node.pages'); $form = node_add('class_content'); return drupal_render($form); }