By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Implementation of javascript in array of name

P: 1
How can I implement javascript to an array. Suppose I have a text box with name=txtphone[]. Though I can implement it for single text box using document.getElementByName("txtphone"), but it's not working for txtphone array.
Oct 24 '11 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
https://developer.mozilla.org/en/DOM/document.getElementsByName
Expand|Select|Wrap|Line Numbers
  1. document.getElementsByName("txtphone[]")
- don't forget the "[]".
Oct 24 '11 #2

Dormilich
Expert Mod 5K+
P: 8,639
Suppose I have a text box with name=txtphone[]. Though I can implement it for single text box using document.getElementByName("txtphone"),
I doubt that. the function is called document.getElementsByName()

other than that name=txtphone[] does not create an array in HTML or JavaScript, it does in PHP.
Oct 24 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.