Código PHP:
   JSP
 
<%-- 
    Document   : TablaProdcuto
    Created on : 01-oct-2013, 17:34:41
    Author     : mxds
--%>
 
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html>
<html:html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <table>
            <thead>
                <tr>
                    <th><input type="checkbox" name="all"|></th>
                    <th>CODIGO</th>
                    <th>PRODUCTO</th>
                    <th>PRECIO UNITARIO</th>
                    <th>SUJETO A CADUCIDAD</th>
                    <th>FECHA DE INGRESO</th>
                    <th>FECHA DE SALIDA</th>
                    <th>EXISTENCIA</th>
                    <th>EXICTENCIA MINIMA</th>
                    <th>ALMACEN</th>
                    <th>PROVEEDOR</th>
                    <th>IMAGEN</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <html:hidden  name="DatoProductoForm" property="idDPF" styleId="idDPF" styleClass="idDPF" />
                <logic:iterate id="producto" name="DatoProductoForm" property="listDUF" >
                    <tr class="tr" id="<bean:write name="producto" property="id"/>" onclick="this.style.background = '#00ff09', pseleccionar(this.id), datos(this.id);">
                        <td style="text-align: center; "><html:checkbox name="producto" property="id" value="id"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="codigo"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="nombre_producto"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="precio_unitario"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="caducidad"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="fecha_ingreso"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="fecha_salida"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="existencia"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="existencia_min"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="proveedor"/></td>
                        <td style="text-align: center;"><bean:write name="producto" property="imagen"/></td>
                        <td style="text-align: center;"><html:checkbox name="producto" property="id"/></td>
                    </tr>
                </logic:iterate>
            </tbody>
        </table>
    </body>
</html:html> 
    Código PHP:
   JS
 
function check() {
    document.getElementById("id of checkbox").checked = true;
    var checkboxValues = new Array();
    $("input:checkbox:checked").each(function() {
        //cada elemento seleccionado
        checkboxValues.push($(this).val());
    });
    alert(checkboxValues);
} 
     
 


 
 

