I’ve modified the django comment form and noticed that it does not output with an html id. How can I add an html id to the entire form?
I need the id so I can get the value of a radio select in jQuery.
EDIT:
I’ve tried Matthew Schinckel’s method below:
var output = $("input[name=rating]:checked").val();
$('#some_div').text(output).fadeIn(500);
This returns nothing.
Django does put the id of every form element in. You may be able to just use this in jQuery. Or, as okm suggested, use the
nameattribute.Or, using django’s default naming:
(The id may differ if you have multiple forms/formsets on your page).