This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes how to use json in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to use json in jsp" Watch "how to use json in jsp" New topic
Author

how to use json in jsp

skevin scott
Greenhorn

Joined: Sep 21, 2013
Posts: 10
<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

Joined: Jan 10, 2002
Posts: 60082
    
  65

I do not believe that you have explained the problem in enough detail for anyone to figure out what you are asking.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: how to use json in jsp
 
Similar Threads
Not able to retrive the Value sent through JavaScript function
Pressing the enter key receive extra invalid data
How to retain the old values?
Display data from database to jsp page.
I keep getting on Javascript Error on the bottom left of IE