Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Mr Crowley

impedir o CTRL+V num campo, como eu faço isso?

Recommended Posts

tenho uma mascara, ta funcionando certinho, porem qdo o usuario faz CTRL+V ele aceita os caracteres que eu bloquiei, como eu faço pra impedir isso?tem como eu bloquear a techa CTRL ou a funcao?seria melhor bloquear a funcao no meu caso....faloe e at+

<html><head><title></title></head><body><form name="form"><table width="238" border="0" cellspacing="0" cellpadding="0">  <tr>    <td width="77">Letra</td>    <td width="161"><input name='Letra' type='text' class='textbox' onKeypress="return MascaraLetra(event);" size='10' maxlength="10"></td>  </tr>  <tr>    <td>Numero</td>    <td><input name='Num' type='text' class='textbox' onKeypress="return MascaraNum(event);" size='10' maxlength="10"></td>  </tr>  <tr>    <td>LetraNum</td>    <td><input name='NumLetra' type='text' class='textbox' onKeypress="return MascaraNumLetra(event);" size='10' maxlength="10"></td>  </tr>  <tr>    <td>Key</td>    <td><input name="key" type="text" id="key" size="1" maxlength="1" onKeypress="return QualKey(event);"></td>  </tr></table></form></body></html><script language="JavaScript">function QualKey(e) {if(window.event) { // for IE, e.keyCode or window.event.keyCode can be used key = e.keyCode; alert(key);}}function MascaraLetra(e) {if(window.event) { // for IE, e.keyCode or window.event.keyCode can be used key = e.keyCode;// alert(key);}else if(e.which) { // netscape key = e.which;}if (key!=8 || key!=32 || key!=44 || key < 64 || key > 91 || key < 97 || key > 122) return (( (key > 64) && (key < 91)) || ((key > 96) && (key < 123)) || (key==8) || (key==32) || (key==44));{  return true; }}function MascaraNum(e) {if(window.event) { // for IE, e.keyCode or window.event.keyCode can be used key = e.keyCode;// alert(key);}else if(e.which) { // netscape key = e.which;}if (key < 48 || key > 57) return (( (key > 48) && (key < 57) ));{  return true; }}function MascaraNumLetra(e) {if(window.event) { // for IE, e.keyCode or window.event.keyCode can be used key = e.keyCode;// alert(key);}else if(e.which) { // netscape key = e.which;}if (key!=8 || key!=32 || key < 48 || key > 57 || key!=44 || key < 64 || key > 91 || key < 97 || key > 122) return (( (key > 48) && (key < 57) ) || ( (key > 64) && (key < 91)) || ((key > 96) && (key < 123)) || (key==8) || (key==32) || (key==44));{  return true; }}</script>

Compartilhar este post


Link para o post
Compartilhar em outros sites

como eu faço pra essa funcao

<script language="JavaScript">function KDown() {var ctrl=window.event.ctrlKey;var tecla=window.event.keyCode; if (ctrl && tecla==86) alert("Impossível COLAR !");if (ctrl && tecla==67) alert("Impossível COPIAR !"); }</script>
funcionar no firefox?

 

tentei isso

<script language="JavaScript">function KDown() {if(navigator.appName == "Microsoft Internet Explorer"){	var ctrl=window.event.ctrlKey;	var tecla=window.event.keyCode;}else{	var ctrl=which.ctrlKey;	var tecla=which.keyCode;}if (ctrl && tecla==86) alert("Impossível COLAR !");if (ctrl && tecla==67) alert("Impossível COPIAR !"); }</script>

mais não consegui....

se puder me ajudar....

 

falo e obrigado novamente...

t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.