posted 13 years ago
this is my requirement and number of answers are dynamically varies i.e for some question
2 answer so on the ui screen chk box1 --- answer1,chk box 2 ---answer2 should display ,
for some question 3 answer so on the ui screen chk box1 --- answer1,chk box 2 ---answer2, chk box 3 ---answer3 should display
so to satisfy above requirement i need to display the check box dynamically.
for(int i=0;i<questionList.size();i++)
{
out.println("<td><input type='checkbox' name='id' value='${i}'> </td>");
out.println(questionList.get(i));
out.println("<br>");
}
using this loop in jsp i need outputp like this
i
1 checkbox1 answer1
2 checkbox2 answer2
3 checkbox3 answer3
here 1,2,3 are the value of variable i
using the above code i am able to get the below output but value of variable i is missing.
checkbox1 answer1
checkbox2 answer2
checkbox3 answer3
so please help me out how to achive this solution.