#9153: Forms (and formsets) don't always generate valid HTML for hidden fields
-----------------------------+------------------------------------
Reporter: mtredinnick | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by Nate):
Replying to [comment:3 anonymous]:
> When using ajax to load a formset, this can cause improper rendering in
the browser. In my case the formset content is sent using
HttpResponse(formset.as_table(),mimetype='application/text'). The
management form at the beginning of the formset is not in a <tr>. The
result is that the tr tags are removed from the entire formset (by the
browser when jQuery.html(data) is called).
>
The following jQuery patched this specific case:
function fixManagement(astable) {
var mngForm = astable.split('<tr>', 1);
var trIndex = astable.indexOf('<th>',1)+4;
var latter = astable.substr(trIndex);
return '<tr><th>'+ mngForm + latter;
}
--
Ticket URL: <https://code.djangoproject.com/ticket/9153#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.