jordanwb Posted September 4, 2009 Share Posted September 4, 2009 I have a form with multiple rows of the same data. When the user clicks on a link, it adds a row to the form. Each same field is named like so: <select name="0[type]"> **Options** </select> <select name="1[type]"> **Options** </select> So on and so forth. I try to get the value of the field like so: var value = document.form_name["0[type]"].selectedIndex; But it doesn't work. When the user clicks "Submit", I use javascript to make sure each field has a value. *Edit* Damn it. I'm an idiot. I was trying to get the selectedIndex of a select that didn't yet exist. Link to comment https://forums.phpfreaks.com/topic/173148-solved-accessing-form-fields-like-an-array/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.