klepec Posted June 2, 2012 Share Posted June 2, 2012 Is there anything wrong if I name html array names (for later php use) like that: name="pic[0]", name="pic[1]", name="pic[2]" instead of just setting all names to: name="pic[]"? I am using jquery validate plugin so i need unique field names, otherwise only first element with the given name gets validated. Thanks Link to comment https://forums.phpfreaks.com/topic/263557-array-name-attributes/ Share on other sites More sharing options...
BarryT06 Posted June 2, 2012 Share Posted June 2, 2012 As far as I know there is not, as the array will index each value, starting at 0. In your case you are making the reference which the array will make anyway. Maybe a more experience designer can point out if I am wrong here. Link to comment https://forums.phpfreaks.com/topic/263557-array-name-attributes/#findComment-1350688 Share on other sites More sharing options...
klepec Posted June 3, 2012 Author Share Posted June 3, 2012 Aha, thanks. I was just wondering if this would cause any problems. Link to comment https://forums.phpfreaks.com/topic/263557-array-name-attributes/#findComment-1350787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.