Hi,

Is there any *official* way of adding my own form element types - e.g. '#type' => 'directory'.
I would like to write my own rendering and basic processing of the type.

Thanks in advance.
Maris

Comments

greg@beargroup.com’s picture

How it was done for image buttons.

http://drupal.org/node/51526

adrian’s picture

check hook_elements.

The only implimentation of it is system_elements.

--
The future is so Bryght, I have to wear shades.

nedjo’s picture

see http://api.drupal.org/api/HEAD/function/hook_elements

Then define a theme function for your element type. Example:


function modulename_elements() {
  $type['directory'] = array();
  return $type;
}

function theme_directory($element) {
  // Your output.
}

mgabalins’s picture

Thanks for help.

MG