Tuesday, February 10, 2009

Should django-uni-form handle boilerplate HTML?

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.

No comments: