Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3237290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:43:18+00:00 2026-05-17T17:43:18+00:00

In drupal fapi there is an attribute #process.what exactly does it?Why password field use

  • 0

In drupal fapi there is an attribute “#process”.what exactly does it?Why password field use it for field duplication instead of adding it with theming?
I want to use it for defining a new field type with hook_elements.

Edit:
here is my hook_elements:

function test_elemets() {  
    return array(
        'test_field' => array(  
            '#input' => TRUE,  
            '#process' => array('test_field_process'),
        )
    );
}

and process callback:

function test_field_process($element, $edit, &$form_state, $complete_form) {
    $element = array();    
    return $element;    
}

as you see in process function I used $element=array() to see what happens.But the form is shown as it was before.why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:43:18+00:00Added an answer on May 17, 2026 at 5:43 pm

    Read the Forms API documentation on the ‘#process’ form element property.

    It is an array of callback functions, each of which will be called with the the element definition array passed to it. The callback function can then act on the element definition array to turn it into a different (usually more complex) definition, like e.g. duplicating a password field while attaching an equality checking JavaScript file, or turning one combined ‘radios’ definition into an according amount of specific single ‘radio’ definitions, etc.

    You will want to use it if you want to offer a complex form element (e.g. a combination of multiple ‘standard’ elements combined, or one with automatic addition of standard JavaScript helpers), but still keep the simple, declarative approach of the Forms API. (Look Ma – only one '#type' = 'myCrazyFormElement' array, that expands ‘automagically’ to something way more complex 😉

    Doing this via the theming layer might be possible, depending on the use case, but would require more code, every time you need it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does drupal have a simple version for reading like drupal_write_record . I want to
Drupal Aggregator core module is a useful one but suffers many problems. There are
Drupal is very much a Do Everything CMS. There are modules that allow you
I'm running Drupal 5 on my website and want to upgrade to V6. I've
Drupal inserts a form_token as a hidden field when it renders forms. The form_token
In Drupal 6 (or even the upcoming 7) is it possible to use OpenID
In Drupal, there is a site I have to work on that has an
In drupal how to add name field to simple news block.If we install simple
Drupal by default does not allow trailing slash for pages and articles. Is it
Drupal is frequently referred as a Content Management Framework, does it comply with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.