-2

Below is the code

I will try to ask this question again later on

Ratan
  • 9
  • 1
  • 7
  • 2
    IDs have to be unique within a document, yours are not – empiric Jan 22 '19 at 14:11
  • [ID's Must Be Unique](http://stackoverflow.com/questions/5611963/can-multiple-different-html-elements-have-the-same-id-if-theyre-different-eleme), specifically because it will cause problems in [JavaScript](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) and CSS when you try to interact with those elements. – Jay Blanchard Jan 22 '19 at 14:12

1 Answers1

0

Your text input fields all have the same ID, so when you're getting the value, it just grabs the value from the first element with that ID. IDs should only exist once per HTML document.

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
markmoxx
  • 1,492
  • 1
  • 11
  • 21
  • You have to be a bit more specific than that. Your update did not help clarify things, you only showed one row, and it still had the same IDs, and you were still targeting those same IDs in your JavaScript file – markmoxx Jan 22 '19 at 15:07