I have been working on forms only recently and I am still puzzeld by them.
What I want are standard Forms:
-
Next Button
-
Submit Data to Db
-
Timestamp
-
Clickable Images with Regions defined where when I click I get to the next page
And
I would like to combine these.
E.g. have a next button + Record the Timestamp.
or
E.g. Click into an Image + Next + Timestamp
If anybody could give me some examples for code that can achieve that or a good online resource on where to get info on that, that would be awesome.
Thanks for the time!!
I’m a little unclear about what you’re trying to accomplish, but if you’re trying to move data from an HTML form to the database, I’d suggest looking at how to use ModelForms. In a nutshell, you create a model class, like this:
Then you create a ModelForm class that references that model:
You can render an instance of MyModelForm in a view function. Inside of a POST request in that view, you bind the POST data to the form, validate it, and call save() on it to commit it to the database: