loud-glass-33663
06/19/2022, 4:29 AM{{ forms.as_p }} or {{ forms.as_table }}
I need to create the forms in HTML by hand as the structure of the page is a little more complex than what these provide.
I know that I can do this (create a HTML form by hand) and then pluck the values in the view.py
using:
value = request.form["name"]
My question is whether this is the recommended way to do this?
I would have hoped that instead of creating the entire form in one go using: {{ <http://forms.as|forms.as>_p }}
, there would be an option to hand-craft individual form elements but with the Django helpers.
After which, I would be able to use the internal Django form helpers to read the values and validate the form.
From my ASP.Net days, I remember we could do something like:
<input type='text' name='forms.student_name.name' value='forms.student_name.value' />
Does Django offer something like this? Any pointer to a tutorial or site I can look at would be appreciated. Thanks!brief-memory-68420
06/19/2022, 6:11 AM{% for field in form %}
{{ field }}
{% endfor %
you can now access field attributes and design them as you likeloud-glass-33663
06/19/2022, 7:24 AM