Hi All,

I want to alter User Registration form.

Want to change the text of the submit button, which by default says "Create new account".

How I can change it using hook_alter_form ?

Please help here

Comments

jschulz-1’s picture

Something similar to this should work. This example would be in you had a Profile field already created with the profile module and wanted a hidden field to capture the where this new user came from.

function yourmodule_form_alter(&$form, &$form_state, $form_id) {

     if ($form_id == 'user_register') {
	     $form['Profile']['profile_refer']['#value'] = $_SERVER['HTTP_REFERER'];
	     $form['Profile']['profile_refer']['#type'] = 'hidden';
    }

}