Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I'm trying to load the profile edit page via ajax so that there is no need for a page reload.
I thought it would have been as simple as:
global $user;
$type = 'profile';
$node = content_profile_load($type, $user->uid);
if (!$node) {
$node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');
}
$form = drupal_get_form($type .'_node_form', $node);
drupal_json(array('status' => 0, 'data' => $form));
But this just returns a blank form.
Does anyone know how I would implement this?
Thanks