You can have both forms in a formset and handle both of them in a single
url, and you can handle your initial validations using HTML and javascript.
docs.djangoproject.com/en/3.0/topics/forms/formsets/

Le lun. 8 juin 2020 à 14:24, Rupesh Dahal <rdaha...@gmail.com> a écrit :

> You can save the data to a session but I would recommend you to store data
> in js in the browser itself.
>
> On Monday, June 8, 2020 at 1:54:53 AM UTC+5:45, Pierre Jutard wrote:
>>
>> I have 2 html pages A and B. The user fills the AForm in the 'A' HTML
>> page(URL: A) then he will go to the 'B' html page (url: A/B) but i would
>> like to keep the AForm data of the 'A'HTML page in the python code in order
>> to use it after in the python function pointing to the 'B' HTML page.
>>
>> My idea was to retrieve the form data in parameter of the function
>> pointing to the 'B' HTML page.
>>
>> First:
>> I have tried to point the form data to the 'B' HTML page via this line in
>> the 'A' HTML page code:
>> <form action="A/B" method="POST">
>>
>> This is the function pointing to the A HTML page:
>>
>> def A_HTML_Function_view(request):
>>     AForm = A_Form()
>>     if request.method == 'POST':
>>         AForm_result = A_Form(request.POST)
>> BForm
>>         return render(request, 'AppName/B.html',{'Bform':Bform})
>>     else:
>>         AForm = A_Form()
>>     return render(request, 'AppName/A.html',{'AForm':AForm})
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/97798c99-102b-47d1-ab1d-e2020f93c0c1o%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/97798c99-102b-47d1-ab1d-e2020f93c0c1o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOwHV6_nfn-0SkdFbutUAT2ohu0HPxjrqF%2Bi76RubK7MkvuewQ%40mail.gmail.com.

Reply via email to