In my jsp file I generate dynamically multiple input tags, trough a database. I'd like to know the values of each. I've tried doing it in Javascript, but according to some answers in this website this is not possible. Example:
<input type="number" id="age" class="v">
<input type="text" id="name class="v">
...
And on the jsp side I'd like to get:
"age" => 18
"name" => "Joe"
Any ideas on how to achieve this?
Edit
In case you are wondering, my Javascript is fairly simple, I can get all the values I need simply by doing:
var chars = document.getElementsByClassName("v");
EDIT 2 My (simplified) JSP looks something like this:
<%= session.getAttribute("chars")%>
<form action="hello" method="POST">
<c:forEach items="${chars}" var="ch">
<input type="number" id="${ch}" class="v">
</c:forEach>
<input type="submit">
</form>
"chars" is an array that was created through calls to the database, this array is displayed and created dynamically.
So what I want to do is pass all those values, like ("age" => 18
) to another my hello servlet, so I can work on that info. For example if the value of the inputs is something like this:
//ID value
"age" => 18
"name" => "Joe"
On hello I should have access to that.