It's difficult to give a hidden form element an ID at this moment because theme_hidden only uses #name and #value. #id's are really useful when working with javascripts.

This can be fixed by overriding the function in your theme, but of course that's not the best approach for something this simple.

CommentFileSizeAuthor
#2 theme_hidden.patch635 bytespraseodym

Comments

praseodym’s picture

To add the id, replace form.inc, line 903:

function theme_hidden($element) {
  return '<input type="hidden" name="'. $element['#name'] . '"  id="'. $element['#id'] . '" value="'. check_plain($element['#value']) ."\" " . drupal_attributes($element['#attributes']) ." />\n";
}
praseodym’s picture

Status: Active » Needs review
StatusFileSize
new635 bytes

Ignore above. Patch against cvs attached.

chx’s picture

Status: Needs review » Reviewed & tested by the community
dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)