By kangaroobin on
How can I give an initial value to my login user and pass box?
My site: http://www.brightboxstudios.com/spokenthreads
Thanks!
How can I give an initial value to my login user and pass box?
My site: http://www.brightboxstudios.com/spokenthreads
Thanks!
Comments
I think you can
I think you can hook_form_FORM_ID_alter the login form then add #default_value on the fields you want.
Need step by step instruction
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?
...
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.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
only put in your form_alter
$form['name']['#value'] = t('name title');
$form['pass']['#value'] = t('password title');
$form['name']['#attributes']['OnClick'] = 'this.value=""';
$form['pass']['#attributes']['OnClick'] = 'this.value=""';
User and password box
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!
for drupal 6 with the above
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(); });what document do i put all
what document do i put all these codes in?