• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to use json in jsp

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic