Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

with javascript, I want to validate an array html like this:

OpenStudy (mattfeury):

i'm not sure I understand what you're trying to accomplish. this is a mix of html and javascript and wouldn't work. you can access the element with javascript by giving it an id: <select id="myId" name="exampleName">...</select> then in your head, use javascript to manipulate: //you can set the name to a value document.getElementById('myId').name = select_name[0]; //or you can read from it: if (document.getElementById('myId').name == select_name[0]) alert('hooray');

OpenStudy (anonymous):

php, I can pick up several selects using the name of the select with "[]" will turn into an array automatically. But that does not work for javascript. The selects are generated dynamically. In this case, then I have to generate unique IDs for each select.

OpenStudy (anonymous):

... and validate using id.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!