Daniel Roy Greenfeld

Daniel Roy Greenfeld

About | Articles | Books | Jobs | News | Tags

Should django-uni-form handle boilerplate HTML?

This was originally posted on blogger here.

This is in regards to my django-uni-form project, which lets you do proper fieldset forms in Django, letting you do prettily formatted forms that meet the Section 508 specification, not to mention various accessibility and usability guidelines.

Basically, I think django-uni-form could be a little more helpful. So what do I mean?

Standard uni-form looks like:


<form class="login uniForm" method="POST" action="">
<fieldset class="inlineLabels">
<legend>_ Required fields</legend>
<div class="ctrlHolder ">
<label for="id_username"> _ User Name</label>
<input id="id_username" type="text" name="username" maxlength="30" />
</div>
</legend>
</fieldset>
<div class="buttonHolder">
<button type="reset" class="resetButton">Reset</button>
<button type="submit" class="primaryAction">Submit</button>
</div>
</form>
django-uni-form gives just:

<div class="ctrlHolder ">
<label for="id_username"> _ User Name</label>
<input id="id_username" type="text" name="username" maxlength="30" />
</div>
Does it make sense for django-uni-form to provide the following?

<fieldset class="inlineLabels">
<legend>_ Required fields</legend>
<div class="ctrlHolder ">
<label for="id_username"> * User Name</label>
<input id="id_username" type="text" name="username" maxlength="30" />
</div>
</legend>
</fieldset>
With this, you can still add in buttons elegantly. Thoughts?

Update: I'm working with James Tauber and perhaps some others to figure out the best way to make this work.


Tags: django forms pinax legacy-blogger