﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19655	Need HTML id's needed for all admin forms	nu.everest@…	nobody	"Creating custom Javascript for django admin forms can be difficult. This is primarily due to the fact that many of the HTML tags in the HTML generated by django admin do not have unique classes or id's.  

For example, if a programmer needs to hide an element in the browser based on a users dynamic choice; then the easiest thing to do is use JQuery's {{{.hide()}}} function. Given the django admin generated HTML below a programmer would use the Javascript {{{$(""div.field-somefield1"").hide();}}} to hide all DIVs associated with the {{{class=""field-somefield1""}}}.  

{{{
<fieldset class=""module aligned "">
    <h2>Frequency</h2>
        <div class=""form-row field-somefield1""></div>
</fieldset>

<fieldset class=""module aligned "">
    <h2>Applicable days</h2>
        <div class=""form-row field-somefield2""></div>
</fieldset>
}}}

Issue:
However, if the programmer wishes to hide a {{{<fieldset>}}} or an {{{<h2>}}} using {{{.hide()}}} they will have to do some sort of convoluted Javascript 'hack' that checks the content of the fieldset OR counts the fieldsets because the django admin makes all of the fieldset's and h2's appear identical at the tag level.

Proposed Solution:
The fix for this seems very simple and straightforward.  Just add unique id's to each element generated by django admin."	New feature	closed	contrib.admin	1.4	Normal	wontfix	custom admin Javascript JQuery HTML id class AJAX		Unreviewed	0	0	0	0	1	0
