Need some help

49 views
Skip to first unread message

Rohit Lohar

unread,
Jun 20, 2022, 1:47:56 PM6/20/22
to Django users
I want to make a form were user will be asked to fill basic details and below that he will have a option to add food and the user can add how many of them he wants so just want to know how can I get the data from user and store it in database??

Kasper Laudrup

unread,
Jun 20, 2022, 3:09:35 PM6/20/22
to django...@googlegroups.com
On 20/06/2022 18.39, Rohit Lohar wrote:
> want to know how can I get the data from
> user and store it in database??
>

https://docs.djangoproject.com/en/4.0/intro/overview/

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Rohit Lohar

unread,
Jun 26, 2022, 1:50:02 PM6/26/22
to Django users
Hi there, 
I am currently making a form where the user will have a option to select from the drop down and an input field next to it. So basically the drop down will have the list of products and the input field will be having an initial value depending upon the choice selected by user. The product name and price have their seperate table so how can I achieve this.
Thank you

Ryan Nowakowski

unread,
Jun 26, 2022, 6:37:45 PM6/26/22
to django...@googlegroups.com, Rohit Lohar
If you want the initial input field value to change dynamically when the select field option changes, there's a bunch of different ways to do this. My current favorite is htmx

https://htmx.org/

- Ryan

Sebastian Jung

unread,
Jun 26, 2022, 6:44:50 PM6/26/22
to django...@googlegroups.com
You can make it easy with javascript on event change on select field then get selected option and write value to input field. You can google for a solution how yoz can get value from a select field on change event

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/86BB9A38-A8CC-4029-AAB4-ED2B6E31D22D%40fattuba.com.

Rohit Lohar

unread,
Jun 26, 2022, 9:12:46 PM6/26/22
to django...@googlegroups.com
Can I make a form with the help of htmx such that the whole form has a small container is dynamic and else whole part is static?

--

Ryan Nowakowski

unread,
Jun 28, 2022, 5:10:02 PM6/28/22
to django...@googlegroups.com
Yup
Reply all
Reply to author
Forward
0 new messages