Form API How to add fields to a core form

drpratten - November 15, 2006 - 21:25

My new 5.0 module needs to add text and a field to a core form (from user.module). Could someone please point me to some examples of this being done?

The form API docs say that it is possible to alter core forms using a hook, but I have been unable to find any examples or explanation.

Your assistance will be appreciated.

Thanks

David

You're in need of

rszrama - November 15, 2006 - 21:43

You're in need of hook_form_alter,

http://api.drupal.org/api/HEAD/function/hook_form_alter

I don't have any handy examples for adding a field, only a simple redirect:

http://www.ubercart.org/ubercart/uberdev/form_redirect_using_hook_form_a...

You might look into logintoboggan, as it uses hook_form_alter to modify the login form and has been updated for 5.0 already.

 
 

Drupal is a registered trademark of Dries Buytaert.