How can I give an initial value to my login user and pass box?

My site: http://www.brightboxstudios.com/spokenthreads

Thanks!

Comments

Anonymous’s picture

I think you can hook_form_FORM_ID_alter the login form then add #default_value on the fields you want.

Drake’s picture

Could you please post a step by step instruction?
I woud like to add the single values to my username adn password field to and would remove the label (username, password).

How can I do that?

Jeff Burnz’s picture

Not sure what you mean exactly but if you want to move the username and password labels into the textfields (which disappears when the user clicks in the field) you can use the jQuery overlabel plugin, works a charm.

ivriets’s picture

$form['name']['#value'] = t('name title');
$form['pass']['#value'] = t('password title');
$form['name']['#attributes']['OnClick'] = 'this.value=""';
$form['pass']['#attributes']['OnClick'] = 'this.value=""';

LEternity’s picture

This worked really well for me.

http://www.topnotchthemes.com/blog/081204/horizontal-user-login-block-us...

The only caveat is that there is a minor bug with autocomplete. If anyone has a solution for that bug, please let us know!

danielbeeke2’s picture

for drupal 6

with the above and this it works perfect

$(document).ready( function(){ $("#header-region label").overlabel(); }); $("input").change(function() { $("#header-region label").overlabel(); }); $("input").keyup(function() { $("#header-region label").overlabel(); });
sunny0’s picture

what document do i put all these codes in?