dear all teacher and gurus.

code we found this

  $types['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'textarea',
    '#theme_wrappers' => array('form_element'),
  );

and said #process take parameter like $element, $form_state, and $complete_form.
but i can not understand or see what those PARAMETERS are exactly in this case or
i missed something ? I mean what $element, $form_state, and $complete_form refer to ?

hope some one can help us make it clear

thank u very much regards

Comments

Jaypan’s picture

$element will be $form['textarea']
$form_state will be the regular $form_state for the form
$complete_form will be the entire form that $form['text_area'] is a part of.

qqboy’s picture

thank u make it clear i think what you mean is
if we have a hook element info

 $types['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => TRUE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'textarea',
    '#theme_wrappers' => array('form_element'),
  );

then we have form render array
$form['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
'#description' => t('The comment will be unpublished if it contains any of the phrases above. Use a case-sensitive, comma-separated list of phrases. Example: funny, bungee jumping, "Company, Inc."'),
'#default_value' => isset(  $context['keywords']) ? drupal_implode_tags($context['keywords']) : '',
);

you mean that $element is $form['keywords']
am i right ?

thank u very much mr JAYPAN

Jaypan’s picture

Yes. If you add a process function to $form['keywords'], then in the process function, $element would be $form['keywords'].

qqboy’s picture

then as we see so many functions here and there
so how to make it clear
it s a headache.
thank you for explaining.
by the way, how did you know the $element is $form

Jaypan’s picture

I don't remember! I probably just examined it. I have a lot of info floating around in my head, that I don't know where it came from.

qqboy’s picture

dont tell me you are a supereman
or you are from mars
or some other planet

i guess you have some secret weapon and a strong brain.

Jaypan’s picture

Not a superman, from earth (well, Canada).

My brain stores Drupal information really well though!