I am customizing the login form. I have to put all the three forms(login, register, forgotpassword) into one page. I don’t want that unwanted root form tag, how can i remove that one? I am using drupal 7. This is my code.
template.php
function bartik_theme() {
$items = array(); $items['user_login'] = array( 'render element' => 'div', 'arguments' => array('form' => NULL), 'variables' => array('form' => NULL), 'path' => drupal_get_path('theme', 'bartik') . '/templates', 'template' => 'user-login', 'preprocess functions' => array( 'bartik_preprocess_user_login' ),
);
return $items;
}
user-login.tpl.php
<div id="signupbox"> <?php $login_form = drupal_get_form ( 'user_login_block' ); echo drupal_render ( $login_form ); $forgot_password_form = drupal_get_form ( 'user_pass' ); echo drupal_render ( $forgot_password_form ); $register_form = drupal_get_form ( 'user_register_form' ); echo drupal_render ( $register_form ); ?> </div>
My problem is that all the 3 forms are rendering in one more form tag.
My Output:
<form action=”/drupal728/user” method=”post” id=”user-login”>
<form>Login</form> <form>Password....</form> <form>Registration....</form>
</form>
I don’t want that unwanted root form tag, how can i remove that one? I am using drupal 7.
Sponsored by SupremePR