Hi everyone...

im new to this forum and also in web application using jsp-jstl.

im having problem passing data from a multilple check box lists.

here's my code:

<form method="post"><sql:query var="charge" dataSource="${datasource}">
                                                            SELECT chargeID, commodity FROM other_charges where charges_typeID = 1
                                                            <span class="cell_content">Toiletries:</span><br />
                                                            <c:forEach var="row" items="${charge.rows}">
                                                                <input type="checkbox" name="toiletries" value="${row.commodity}" />${row.commodity}<br />
                                                                <input type="hidden" name="toiletID" value="${row.chargeID}" size="2" />

<c:if test="${pageContext.request.method=='POST'}">
                                                    <sql:query var="toilet" dataSource="${datasource}">
                                                        SELECT commodity FROM other_charges where chargeID = ${param.toiletID}
                                                    <c:forEach var="row" items="${toilet.rows}">

I used the input text box to hold the id's of each data to pass when i click the submit button but the result appeared of my query after submission is just the first data that has been queried using foreach inside the form tag. need help guys.

problem solved! all I needed was, to use paramValues. argh!

here's the code:

<c:forEach var="row" items="${paramValues.toiletries}">
${row}<br />

I have the same problem, but your solution didn't work

Here is my code

            <table border="1" align="center" valign="center">
                <c:forEach var="row" items="${parcelas.rows}">

                            <input type="checkbox" name="id" value="${row.parcelaID}" >
                    <td><c:out value="${row.parcelaID}"/></td>
                    <td><c:out value="${row.parcelaVencimento}"/></td>
                    <td ><c:out value="${row.parcelaValor}"/></td>
                    <td><c:out value="${row.clienteID}"/></td>



  <input type="submit" value="OK" />


<c:forEach var="row" items="${param.id}">
    <c:out value="${row}"/><br/>


I worked

But I still lose , what checkbox I checked
Do you know how to maintain them ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.