Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Altering forms with hook_form_alter()

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    In this chapter, we're going to discuss
  • 0:10
    altering a form that another module has created.
  • 0:13
    We're going to utilize hook_form_alter, and you can look this up right on api.drupal.org.
  • 0:20
    And for this example what I'd like to do is when a user tries to change their password,
  • 0:27
    I want to make sure they don't put in a password that is unsafe.
  • 0:31
    As it is right now, when you try to change your password,
  • 0:33
    Drupal does a check to, A, make sure password field 1 and 2 match
  • 0:39
    and it also gives you, kind of, a rating of is it secure
  • 0:42
    and it's some sort of, you know, algorithm that it's come up with.
  • 0:45
    The things it doesn't check against are things like,

Altering Forms with hook_form_alter()

Loading...

This video goes through the process of changing some of the properties of a form with the hook_form_alter() function. This hook is a very powerful tool to be able to modify existing Drupal forms, created by core or contributed modules, and tailor them to your needs.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.