It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

Pass integer value from a checkbox on JSP to the server

Pass integer value from a checkbox on JSP to the server

Postby albertkao on Thu Feb 11, 2010 6:45 pm

How to pass integer value from a checkbox on JSP to the server?
None of the following 3 checkboxes will pass an integer to the server.
The server receive "k" or "$k" but not 1, 2, 3, ....
<td><input type="checkbox" name="choice" value="k">Data</td>
<td><input type="checkbox" name="choice" value="$k">Data</td>
<td><input type="checkbox" name="choice" value=k>Data</td>

The JSP page is:
<c:set var="k" value="0"/>
<c:forEach items="${model.data}" var="data">
<tr>
<c:forEach items="${data}" var="datavalue">
<td style="font-family:monospace">${datavalue}</td>
</c:forEach>
<td><input type="checkbox" name="choice" value="k">Data</td>
<c:set var="k" value="$(k+1)"/>
</tr>
</c:forEach>
albertkao
 
Posts: 4
Joined: Wed Feb 03, 2010 6:21 pm

Who is online

Users browsing this forum: No registered users and 0 guests