hostfreak Posted September 3, 2007 Share Posted September 3, 2007 Say I have two inputs in a form that creates an array with the square-bracket syntax, example: <input name="Quantity[inventory]" type="text" /> <input name="Quantity[Commercial]" type="text" /> How would I access those values in javascript? I've tried getElementById() to no avail. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/67763-accessing-array-values/ Share on other sites More sharing options...
vijayfreaks Posted September 4, 2007 Share Posted September 4, 2007 Hi.. for that you can do one thing.. assign unique id relatively names... and you can access it via document.getElementById('id'); Regards, Vijay Link to comment https://forums.phpfreaks.com/topic/67763-accessing-array-values/#findComment-341073 Share on other sites More sharing options...
hostfreak Posted September 4, 2007 Author Share Posted September 4, 2007 I thought of that as a possibility, but just wanted to make sure there wasn't a better way. I will keep this open for now, in case someone does know of a better way. Thanks for the idea, that's what I will use for the time being. Link to comment https://forums.phpfreaks.com/topic/67763-accessing-array-values/#findComment-341293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.