Hi Guys,
I am trying to design the user login form like adding some additional div's that will look like THIS. Adding some float left and right to my divs. How can I do that?

Right now I have check the function user_login_block() but it just adds the HTML input tags in a sequencial way.

Cheers,
Mark

Comments

Kuldip Gohil’s picture

you can add div by using #prefix & #suffix with form element in form_alter hook. and also change weight of field.

marknt15’s picture

I will try that out and will reply here if I have any further questions regarding my problem. Thanks again :)

marknt15’s picture

Hi kuldip, I am trying to replace the whole code of the function user_login_block to add the design that I want but I don't know how to add a div and attack a class attribute to it. You said #prefix and #suffix so in the fuction user_login_block I will add this:

    $form['div'] = array('#type' => 'div',
        '#prefix' => <What will i put here

,
);
?>
Is that correct?

Current code:

function user_login_block() {
	
    $form['div'] = array('#type' => 'textfield',
        '#title' => t('Username'),
        '#maxlength' => USERNAME_MAX_LENGTH,
        '#size' => 15,
        '#required' => TRUE,
    );

    $form['links'] = array('#value' => theme('item_list', $items));
    return $form;
}

function user_block($op = 'list', $delta = 0, $edit = array()) {
    $block['content'] = drupal_get_form('user_login_block');
}

Thanks in advance.

Cheers,
Mark