Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/05/2009, 08:16
Avatar de colote
colote
 
Fecha de Ingreso: julio-2008
Ubicación: Rosario - Santa Fe - Argentina
Mensajes: 729
Antigüedad: 15 años, 10 meses
Puntos: 8
Pregunta Como saltar un campo oculto con tabulador "enter" ?

Hola gente !!!
Tengo una funcion que tabula con la tecla enter :
Código PHP:
function tabular(e,obj
        {
            
tecla=(document.all) ? e.keyCode e.which;
            if(
tecla!=13) return;
            
frm=obj.form;
            for(
i=0;i<frm.elements.length;i++) 
                if(
frm.elements[i]==obj
                { 
                    if (
i==frm.elements.length-1
                        
i=-1;
                    break 
                }
            if (
frm.elements[i+1].disabled ==true )    
                
tabular(e,frm.elements[i+1]);
            else 
frm.elements[i+1].focus();
            return 
false;
        } 
La funcion anda joya, el problema se presenta cuando tengo un campo oculto, se me queda ahi trabado y no pasa al siguiente !!!

Los campos por ejemplos asi
Código PHP:

<input type="text" size="2"  name="codep_1" onkeypress="return tabular(event,this)"/>
<
input type="hidden" name="var_cont_piezas" onkeypress="return tabular(event,this)">
<
input type="text" size="40" name="namep_1" onkeypress="return tabular(event,this)"/> 
Lo puse en este foro, pero cualquircosa lo movemos ... no se va para js ?

Gracias, Ricardo !!!
__________________
Mail: [email protected]