-4

Does an html form like this submit results in an order like below? from top of form to bottom of form.

<form method="GET">
  <input type="text" name="fname">
  <input type="text" name="mname">
  <input type="text" name="lname">
</form>
{
 fname => "",
 mname => "",
 lname => ""
}

EDIT: Considering what Quentin said, does phoenix persist the order of HTML forms when submitting to the server?

E_net4
  • 27,810
  • 13
  • 101
  • 139
tblev
  • 422
  • 4
  • 13
  • What is that fat arrow display? Its not clear at all what you are asking. – zipzit Dec 02 '21 at 22:45
  • @zipzit I'm interested in learning if the data submitted in the form is always sequential. I'm trying to figure out if html or phoenix scramble the form params when a form is submitted, or if the order is persisted. The rocket is a data structure, perhaps I should've been more conscientious that the html forum might not know anything about data structures, my bad. Though it seems pretty clear that I'm asking: Does the html submit form params in an order like ? The only thing is maybe add a MWE. – tblev Dec 03 '21 at 14:00

1 Answers1

1

Data is submitted in the order it appears in the form.

You can confirm this by inspecting the request payload in the Network tab of the developer tools in your browser.

Server-side code which processes the form submission might change the order.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335