I updated my post up top to pull in the user form created in Drupal, it now loads it in a lightbox correctly, how can I submit this using AJAX, validate this all in the Lightbox? any ideas?
Any help would be good help :)
<?php
function ajax_register_menu() {
$items['request'] = array(
'page callback' => 'ajax_register_mypage',
'page arguments' => array('ajax_register_form'),
'type' => MENU_CALLBACK,
'access callback' => TRUE,
'title' => t('MY TITLE'),
);
$items['request/submit'] = array(
'page callback' => 'ajax_register_submit',
'type' => MENU_CALLBACK,
'access callback' => FALSE,
);
return $items;
}
function ajax_register_mypage($form){
print '<div style="background: #FFFFFF;">';
print 'Hello World';
print render(drupal_get_form('user_register_form'));
print '</div>';
}
function ajax_register_submit() {
$returnO = new StdClass();
$returnO->status = true;
$returnO->message = 'MY INFORMATIVE MESSAGE HERE';
print drupal_json($returnO);
die;
}
?>