Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2010, 16:59
Avatar de masterojitos
masterojitos
 
Fecha de Ingreso: julio-2008
Ubicación: Lima Callao Chucuito
Mensajes: 1.931
Antigüedad: 15 años, 9 meses
Puntos: 105
Respuesta: Evitar copiar texto de una Caja de texto

Es un tema bien difundido.... pero bueno, tenia un ejemplo entre mis recursos webs....

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Creado por MasterOjitos</title>
  5. <script type="text/javascript">
  6. function noControl(e){
  7.     var key = (document.all) ? e.keyCode : e.which;
  8.     if(e.ctrlKey) return false;
  9. }
  10. </head>
  11. <form name="form" method="post">
  12. <input type="text" name="clave" oncontextmenu="return false;" onkeypress="return noControl(event);" /><br />
  13. <input type="text" name="confirmar" oncontextmenu="return false;" onkeypress="return noControl(event);" /><br />
  14. </form>
  15. </body>
  16. </html>

con oncontextmenu="return false;" prohibes que den click derecho sobre los inputs.
y con onkeypress="return noControl(event);" prohibes que presionen la tecla "Control" sobre los inputs.

Suerte.
__________________
Atte. MasterOjitos :ojotes:
Todo sobre Programación Web
Las ultimas tendencias en Efectos y Recursos Web: MasterOjitos Blog