down votefavorite 
<https://stackoverflow.com/questions/53010061/html-multi-button-form-using-in-django-app#>

I have a html form with multi buttons and html tabs processing for every 
button(for example after to push button n01 i take tab 2 with button n02 
after push button n02 i take tab 3 with button n03 where is the final 
button).

my question is to take data from button no1(tab 1) and serve to page 
no2(after push button n01)?

if i keep type="button" then in my view i dont take anything if i change to 
type="submit" then in my view i take results but after push button n01 
refresh my page and start to begin again (dont take to tab 2)

html form :

    <form role="form">
    ..........................
    <input type="radio" name="n">
    <ul class="list-inline pull-right">
    <li><button name='n01' type="button" class="btn btn-primary next-step">Save 
and continue</button></li>
   .........................
   <input type="radio" name="m">
    </ul>
    <ul class="list-inline pull-right">
    <li><button name='n02' type="button" class="btn btn-primary next-step">Save 
and continue</button></li>
    </ul>
    ..........................
    <input type="radio" name="s">
    <ul class="list-inline pull-right">
    <li><button name='n03' type="button" class="btn btn-primary next-step">Save 
   and continue</button></li>
    </ul></form>

django view :

if request.method == 'POST' and 'n01' in request.POST:
   do somethingif request.method == 'POST' and 'n02' in request.POST:
   do something else

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b240324e-483b-4fbf-b5b0-fd63902c02bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to