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
Post a Comment