javascript - Get dynamic request params in node.js -


how can construct array says have dynamic dom below?

<input type="hidden" name="file1" value="1.jpg"> <input type="hidden" name="file2" value="2.jpg"> <input type="hidden" name="file3" value="3.jpg"> <input type="hidden" name="file4" value="4.jpg"> .. .. , on 

one way save input calculate length of file, req.body.number_of_file later on can loop through that.

is there alternative it?

if inputs consistently , consecutively numbered, in example, go for:

<input type="hidden" name="files" value="4"> <!-- or 5, 6, 42, etc. --> 

otherwise, try having inputs part of input array:

<input type="hidden" name="files[]" value="1.jpg"> <input type="hidden" name="files[]" value="2.jpg"> <input type="hidden" name="files[]" value="3.jpg"> <input type="hidden" name="files[]" value="4.jpg"> 

node.js doesn't support input arrays; here's question tips that: node.js form elements array


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -