javascript - Should I always generate a unique Id and Name for every <input> element I submit? -


i generate unique id , name every input want submit,

<input name='text1'/> <input name='text2'/>  

however feel using name array more comfortable.

<input name='text[]'/> <input name='text[]'/> 

does name array have identity problem or other con?

if use php, array when using [] convenient gather fields of similar type.

from javascript point of view, there no issues other slight inconvenience use form["text[]"] or form.elements["text[]"] access fields


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -