Drupal example on how to use form alter hook

/ Published in: PHP
Save to your folder(s)

Resizing fields using a custom module

You could also resize the field using a custom module.
For example, if you created mysite.module, you could use something like this to reduce the field size to 30 characters

Copy this code and paste it in your HTML
  1. function mysite_form_alter(&$form, &$form_state, $form_id)
  2. {
  3. switch ($form_id)
  4. {
  5. case 'user_profile_form':
  6. $form['account']['name']['#size'] = 30;
  7. $form['account']['mail']['#size'] = 30;
  8. break;
  9. }
  10. }

URL: http://geeksandgod.com/forums/dynamic-website-forums/all-about-drupal/resize-registration-email-and-name-textfield-drupal-6

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.