R
R
retyui2015-04-15 01:45:39
JavaScript
retyui, 2015-04-15 01:45:39

Nested data structures passed through html form?

Approximate form structure:

<form action="">
    <input type="text" name="title">
    <input type="text" name="year">
    <input type="submit" value="Send">
  </form>

And the desired result on the server:
[
  {
    title: "1..."
    yaer:2015
  },
  {
    title: "2..."
    yaer:2012
  },
  ...
]

How to make a form? To get the desired structure

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2015-04-15
@retyui

<input type="text" name="data[0][title]">
<input type="text" name="data[0][year]">
<input type="text" name="data[1][title]">
<input type="text" name="data[1][year]">

T
Timur Shemsedinov, 2015-04-15
@MarcusAurelius

stackoverflow.com/questions/4295782/how-to-you-ext...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question