html - How to pass multiple text field's updated value in the same row to controller using hyperlink? -
i have 1 jsp page in showing records in table in jsp. in table (the jsp) every row has 1 column have put 'edit' hyperlink. if updating value in text fields in same table. after clicking on link, want updated text field's value in controller. can 1 tell me how achieve goal?
<table border="2"> <tr> <th>student id</th> <th>first name</th> <th>last name</th> <th>age</th> <th>contact no.</th> <th>click here edit</th> <th>click here save</th> </tr> <c:foreach items="${list}" var="currentstudent"> <%!int count = 0; %> <tr> <td> <input name = "sid" type="text" value= "${currentstudent.studentid}" size="10" /> </td> <td> <input id = "fn<%= count%>" name = "fn" type="text" value= "${currentstudent.firstname}" size="10"/> </td> <td> <input id = "ln<%= count%>" name = "ln" type="text" value= "${currentstudent.lastname}" size="10"/> </td> <td> <input id = "age<%= count%>" name = "age" type="text" value= "${currentstudent.age}" size="10"/> </td> <td> <input id = "mno<%= count%>" name = "mno" type="text" value= "${currentstudent.mobileno}" size="10"/> </td> <td> <input name = "edit" type="button" value= "edit" size="100" onclick="enablefields"/> </td> <td> <a id = "link" href="modifystudent?sid=${currentstudent.studentid}&fn=_&ln=_&age=_mno">save</a> </td> </tr> <%count++; %> </c:foreach> </table>`
i have put _ need insert logic getting value of same row's text field's.
can 1 suggest logic?
Comments
Post a Comment