aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60049
    
  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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use json in jsp
 
Similar Threads
Not able to retrive the Value sent through JavaScript function
How to retain the old values?
I keep getting on Javascript Error on the bottom left of IE
Pressing the enter key receive extra invalid data
Display data from database to jsp page.