Implementation of javascript in array of name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bharti Kumawat
    New Member
    • Oct 2011
    • 1

    Implementation of javascript in array of name

    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.getEle mentByName("txt phone"), but it's not working for txtphone array.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    https://developer.mozil la.org/en/DOM/document.getEle mentsByName
    Code:
    document.getElementsByName("txtphone[]")
    - don't forget the "[]".

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      Suppose I have a text box with name=txtphone[]. Though I can implement it for single text box using document.getEle mentByName("txt phone"),
      I doubt that. the function is called document.getEle mentsByName()

      other than that name=txtphone[] does not create an array in HTML or JavaScript, it does in PHP.

      Comment

      Working...