Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How are get the selection values from a group Yes/No Radio Buttons in JSTL

819684Nov 30 2010 — edited Dec 7 2010
I am new to JSTL, we have an old JSTL app, I need to build a group of yes and no radio buttons and update the DB based on the selected value of each question.

<c:forEach var="rowList" varStatus="status" items="${appCompFAQs.rows}">

<td align="center"><input type="radio" name="cfaqId" value="<c:out value="${rowList.CFAQID}"/>"/>No&nbsp;|&nbsp;<input type="radio" name="cfaqId" value="<c:out value="${rowList.CFAQID}"/>" checked/>Yes</td>

<c:/forEach>

However I am not sure how to get the selected value (Yes or No) along with FAQ_ID so I can update the database like below. Any suggestion ?

if it is a group of checkbox, it will be much easier like below.

<c:forEach var="cfaqId" items="${paramValues.cfaqId}" >
<sql:update sql="Update CompFAQLink set Status = 'N' where AppID = ? and CFAQID=? ">
<sql:param value="${param.appId}" />
<sql:param value="${cfaqId}" />
</sql:update>
</c:forEach>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2011
Added on Nov 30 2010
5 comments
2,425 views