Ideas, vivencias y demás
Peru Blogs

August 26, 2009

Deshabilitar el backspace y el enter cuando no estan siendo usados en controles

Encontré lo que necesitaba!, código para bloquear el backspace y el enter si no se esta dentro de un control en el webform. Aquí la fuente y aquí el código:

// Trap Backspace(8) and Enter(13) -
// Except bksp on text/textareas, enter on textarea/submit

if (typeof window.event != ‘undefined’) // IE
  document.onkeydown = function() // IE
    {
    var t=event.srcElement.type;
    var kc=event.keyCode;
    return ((kc != 8 && kc != 13) || ( t == ‘text’ &&  kc != 13 ) ||
             (t == ‘textarea’) || ( t == ’submit’ &&  kc == 13))
    }
else
  document.onkeypress = function(e)  // FireFox/Others
    {
    var t=e.target.type;
    var kc=e.keyCode;
    if ((kc != 8 && kc != 13) || ( t == ‘text’ &&  kc != 13 ) ||
        (t == ‘textarea’) || ( t == ’submit’ &&  kc == 13))
        return true
    else {
        //alert(’Sorry Backspace/Enter is not allowed here’); // Demo code
        return false
    }
   }

August 4, 2009

Date Formatting in Reporting Services - list of format codes

Filed under: Otros

Lo encontré y para no olvidar, acá lo dejo.






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham