Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wanted to add an onclick function to a cck field to fire off a javascript, I tried to use $form[field][#atributes] as usual in hook_form_alter, but for some reason this is not working. the element type is optionwidget_onoff.