# How to get the dropdown values to the next page using Django

**URL:** <https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267>\
**Category:** Using Django\
**Created:** [July 3, 2020, 3:15pm UTC](https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267 "2020-07-03T15:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sam/32/1579_2.png) [@Sam](https://forum.djangoproject.com/u/Sam)\
**Post date:** [July 3, 2020, 3:15pm UTC](https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267/1 "2020-07-03T15:15:37Z")

</div>

I have two dropdowns and a button on HTML form.The values in the second dropdown are dynamically updated using js based on the value selected in first dropdown.When I select the values and click on button,it navigates to a different page which also displays the same elements with additional information.How to send these values to the navigated page and set it to the previously selected values?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 3, 2020, 5:42pm UTC](https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267/2 "2020-07-03T17:42:58Z")

</div>

You would want your submit button to submit those values as parameters - either as part of the URL, or as form data, or even possibly as JSON.

Your view would then accept that data, and use that to specify the initial values in your second page.

---

<div class="post-metadata">

**Author:** ![Sam](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sam/32/1579_2.png) [@Sam](https://forum.djangoproject.com/u/Sam)\
**Post date:** [July 3, 2020, 6:21pm UTC](https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267/3 "2020-07-03T18:21:08Z")

</div>

I am new to Django and still learning it.Could you give me a programmatic example?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 3, 2020, 6:29pm UTC](https://forum.djangoproject.com/t/how-to-get-the-dropdown-values-to-the-next-page-using-django/3267/4 "2020-07-03T18:29:05Z")

</div>

I’m interpreting the first part of your post as being something you’ve already handled (setting the second dropdown based on the selection of the first.) Your button then is the submit button for that form.

Submitting that form is going to call a view - the view then rebuilds the form populated with the post data. You can then use _that_ data from the form to set your defaults and to build the form for the second view.

I don’t have any code to share for that specific situation. If you post your forms, models, views, and templates that you have so far, I can help point you in the right direction for your situation.

Ken
