Anyone have experience adding a boostrap accordion inside a Django form?
We use bootstrap in our projects, but not that widget. Do you have a specific question or issue?
The project I have is mobile first. Users have many items in lists to pick from and the accordion will work well for this application. I understand that if your not using {{ form }}
then Django’s form checking will not be uses. Is this correct? I would like to implement form error checking. Can the individual form elements be access inside the form with error checking? For example will {{ form.first_name }}
set up as a required filed be flagged with an error in the form if it’s required and not filled out?
What widgets do you use for an expanding/contacting list in your projects?
Also, is crispy forms necessary to implement bootstrap? I have used it some tutorial projects but I don’t see why its needed if you install/CDN boostrap in your project.
Before I say that this is not correct, I’d like to know where you saw that as being true. (There might be some additional context behind that statement making it true under some specific circumstance.) In general terms, no, that’s not an accurate statement.
The use of {{ form }}
or {{ form.field }}
is something done at the time the form is rendered. Form error checking occurs in the server after the form has been POSTed - with the possibility that there is some JavaScript attached to the page allowing for some “pre-screening” or “pre-validation” before the form is submitted.
However, regardless of what happens in the client, the server must always validate submitted data - you must not rely only upon any form of browser-based validation, because it’s too easily bypassed.
We don’t. When we have information that is too big to present on one page, or if we just want to organize or segregate data, we use a “tab” structure.
No, it’s not required. (We do use crispy, but not just for implementing bootstrap.) Again, I’m curious to know what you might have read that would give you that impression.
Your pages being rendered are HTML pages. Anything you can do in a generic HTML page can be replicated within a Django template.