Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/11/2005, 08:55
Juanin
 
Fecha de Ingreso: octubre-2005
Mensajes: 28
Antigüedad: 18 años, 6 meses
Puntos: 0
Exclamación Problemas con checkbox

Este codigo me funciona sin problemas con Ie pero con mozilla no funciona...... cual es el problema ya he visto todo el foro pero aun no encuentro la solucion....

Tengo varios Checkbox con el mismo nombre, pero el value es distinto para poder diferenciarlos...

<input type="checkbox" id="selectionCheck" value="id">
</input>

entonces cuando hago submit llama a GetSelectedItemsCount() y me entrega el numero checkbox que estan selecionados... si no hay ninguno me arroja 0.

Pero esto no me funciona con mozilla.

Código PHP:

function GetSelectedItemsCount()
{
    if (
typeof(document.Form.selectionCheck) != "undefined")
        return 
Sel_GetSelectedItemsCount(document.Form.selectionCheck);
    else
        return 
0;
}



function 
Sel_GetSelectedItemsCount(itemlist)
{
    if (
typeof(itemlist) == "undefined")
    {
        return 
0;
    }

    
cant itemlist.length;
    if(!
cant)
    {
        if (
itemlist.checked)
            return 
1;
    }
    else
    {
        
count 0;
        for(
gsici 0gsici cantgsici++)
        {
            if (
itemlist[gsici].checked)
                
count++;
        }
        
        return 
count;
    }