Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Aug 2007 at 20:29 UTC
Updated:
2 Jan 2014 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jadwigo commentedthis is fixed for drupal 6.x http://drupal.org/node/145135#comment-557450
but it might be nice to include this in the next drupal 5.x update too
(just change line 55 of form.inc to
$form_build_id = 'form-'.md5(mt_rand());if you need a quick fix)Comment #2
mr.baileysBump. Are bug fixes still applied against 5.x-dev? Or are changes limited to security fixes?
If this has no chance of making it into 5.x-dev anymore, I guess it should be marked "won't fix".
Comment #3
mr.baileysTagging.
Comment #4
sunStill an issue in D7. The 'id' attribute shouldn't exist in the first place here.
Comment #5
Robatron commentedHere's a patch for the fix jadwigo described above for the 5.x-dev version.
I should add that this is my first patch submission to Drupal, so if I manage to screw up this bug report by posting, or if I'm not posting in the correct manner, or my patch isn't in the correct format, etc. I apologize :-)
Comment #6
hass commentedComment #7
sunBetter title.
We just want to remove the ID attribute from all hidden form elements. Simple. They make no sense at all, as you cannot style hidden input elements, and you can easily access them via jQuery attribute selectors. I can only guess that those IDs date back to Drupal 4.7, when we only had our custom
$()JavaScript function to select DOM element #ids in the markup.Comment #8
sunhah, forgot that tag
Comment #9
sunThere's absolutely no need for those IDs and no reason to keep those IDs.
So let's fix a bug, and additionally vastly decrease the markup length.
If anyone still needs an ID attribute on a hidden element, one can still assign #attributes][id just fine. Just no auto-generated IDs.
Did not remove the #id assignments in drupal_prepare_form(), because the #id properties for the required hidden Form API elements are constructed in a special way. If, for some reason, someone would like those to appear as in D6 and below, one can write a hook_form_alter() that simply does $element['#attributes']['id'] = $element['#id'] for one or all of those elements.
Comment #10
bleen commentedthem_hidden has changed since August...
On one hand, the error pointed out in the original post no longer exists (it appears that IDs are preprended with 'form-' (or similar) so there wont ever be an id starting with a numeral), on the other hand there is still no compelling reason to have the ID appear at all ...
So as long as we're here, lits just kill it and make the markup more better...
re-roll attached
Comment #11
sunThe IDs get still generated, but I think that's OK + eventually allows someone to safely take over #id into attributes][id.
Comment #12
dries commentedCommitted to CVS HEAD. Thanks.