Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Hook_widget() controls the behavior of the widget, which is primarily to create and validate the edit form. The 'process form values' operation should be used as an opportunity to do any manipulation of the form values before they are saved. This operation is also called before previews, so anything that needs to be done to preview the value correctly should be handled in this operation.
function moodle_widget(&$form, &$form_state, $field, $items, $delta = 0)
For some reason, the $items array contains an array confusingly named $items:
Array
(
[items] => Array
(
[0] => Thing 1
[1] => Thing 2
)
[header] =>
[#theme] => thing_field
)
Comments
"process form values" was deprecated in D5
"process form values" is a cck/drupal 5 construct and does not exist in d6. you will want to use a "process callback" to get the results described above.
d7 porting of hook_widget
Where does this functionality go in d7 as i don't see ant hook_widget available in d7.