Im using drupal 6.16. The below code for hook_form_alter is not working. Im simply trying to change the 'Log In' to 'Sign In' on the submit button of the user login form
<?php
//$Id$
function helloworld_form_alter($form_id,&$form) {
switch ($form_id) {
case 'user_login_form':
// Change 'Log in' to 'Sign in'.
$form['submit']['#value'] = t('Sign in');
break;
}
}
Any way to fix this ?
Please help. Thank You.
There are two errors in your code:
yourModuleName_form_alter(&$form, &$form_state, $form_id)
, so in your example the switch on the form id will never trigger.user_login_block
for the small login form available as a block (commonly used on most pages)user_login
for the explicit login page (usually found under 'user/login')Both forms are mostly identical in structure, so you can usually change both within the same hook_form_alter
implementation - just add another case statement to check for the second version.