Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/06/2009, 09:22
Avatar de spider_boy
spider_boy
 
Fecha de Ingreso: diciembre-2003
Ubicación: Chile
Mensajes: 1.855
Antigüedad: 21 años, 1 mes
Puntos: 89
Respuesta: pasar arreglo como parametro a funcion (onkeydown)

Ok xD

Código:
function onkeyFncArray(e, array){
    tecla = (document.all) ? e.KeyCode : e.which
    
    for(x in array)
    {
        if(tecla==x)    {
            eval(array[x]);
        }
    }
}     

<input type='text' id='uno' value='texto' 
onkeydown="onkeyFncArray( event, {13:'alert(\'algo1\')' , 107:'alert(\'algo2\')');">
<input type='text' id='dos' value=''>
Espero te sirva. Nos vemos xD.
__________________
Nunca te olvidaré mi negra hermosa. Te extraño demasiado.