• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use json in jsp

 
skevin scott
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:forEach var="ques" items="${result.rows}">

${ques.question}<br>

<input type="radio" name="group" value="${ques.ans_a}" /> ${ques.ans_a}<br>
<input type="radio" name="group" value="${ques.ans_b}" /> ${ques.ans_b}<br>
<input type="radio" name="group" value="${ques.ans_c}" /> ${ques.ans_c}<br>
<input type="radio" name="group" value="${ques.ans_d}" /> ${ques.ans_d}<br>

<input type="submit" value="Check" onclick="loadJSON();" />
<hr>

</c:forEach>

This is used to print question and answers in page.

I want to check each question after answer question , check button is used for that.
there I use json for load a correct answer.

<c:forEach var="ques" items="${result.rows}">

${ques.question}<br>

<input type="radio" name="group" value="${ques.ans_a}" /> ${ques.ans_a}<br>
<input type="radio" name="group" value="${ques.ans_b}" /> ${ques.ans_b}<br>
<input type="radio" name="group" value="${ques.ans_c}" /> ${ques.ans_c}<br>
<input type="radio" name="group" value="${ques.ans_d}" /> ${ques.ans_d}<br>
<div id="Name"></div> //this div is used to display updates . this is connect with the javascript and it is connect with json file for get a data
<input type="submit" value="Check" onclick="loadJSON();" />
<hr>

</c:forEach>

When I use in this method, if any check button pressed, only 1st question update


how I solve this problem?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not believe that you have explained the problem in enough detail for anyone to figure out what you are asking.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic