Ir para conteúdo

POWERED BY:

Arquivado

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

Boris

Formulario não pode aceitar espaço primeiro

Recommended Posts

Galera estou com um problema, tenho um formulario que envia os dados para o Banco, o formulario tem validação mas quando aperta o espaço e não coloca nada na frente ele aceita e não podeira aceitar....

 

alguem sabe um script para o mesmo

 

 

meu codigo está logo abaixo.

 

FORMULARIO

<script>
//--->Função para a formatação dos campos...<---
function Mascara(tipo, campo, teclaPress) {
	if (window.event)        {
		var tecla = teclaPress.keyCode;        
		} 
		else {
			tecla = teclaPress.which;        
			}         
			var s = new String(campo.value);        
			// Remove todos os caracteres à seguir: ( ) / - . e espaço, para tratar a string denovo.        
			s = s.replace(/(\.|\(|\)|\/|\-| )+/g,'');
			tam = s.length + 1;
			if ( tecla != 9 && tecla != 8 )
			{                
			switch (tipo)
			{                
			case 'CPF' :
			if (tam > 3 && tam < 7)
			campo.value = s.substr(0,3) + '.' + s.substr(3, tam);
			if (tam >= 7 && tam < 10)
			campo.value = s.substr(0,3) + '.' + s.substr(3,3) + '.' + s.substr(6,tam-6);
			if (tam >= 10 && tam < 12)
			campo.value = s.substr(0,3) + '.' + s.substr(3,3) + '.' + s.substr(6,3) + '-' + s.substr(9,tam-9);
			break;
			case 'CNPJ' :
			if (tam > 2 && tam < 6)
			campo.value = s.substr(0,2) + '.' + s.substr(2, tam);
			if (tam >= 6 && tam < 9)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,tam-5);
			if (tam >= 9 && tam < 13)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,3) + '/' + s.substr(8,tam-8);
			if (tam >= 13 && tam < 15)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,3) + '/' + s.substr(8,4)+ '-' + s.substr(12,tam-12);
			break;
			case 'RG' :
			if (tam > 2 && tam < 6)
			campo.value = s.substr(0,2) + '.' + s.substr(2, tam);
			if (tam >= 6 && tam < 9)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,tam-5);
			if (tam >= 9 && tam < 13)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,3) + '-' + s.substr(8,tam-8);
			if (tam >= 13 && tam < 15)
			campo.value = s.substr(0,2) + '.' + s.substr(2,3) + '.' + s.substr(5,3) + '/' + s.substr(8,4)+ '-' + s.substr(12,tam-12);
			break;
			case 'TEL' :
			if (tam > 2 && tam < 4)
			campo.value = '(' + s.substr(0,2) + ') ' + s.substr(2,tam);
			if (tam >= 7 && tam < 11)
			campo.value = '(' + s.substr(0,2) + ') ' + s.substr(2,4) + '-' + s.substr(6,tam-6);
			break;             
			case 'DATA' :
			if (tam > 2 && tam < 4)
			campo.value = s.substr(0,2) + '/' + s.substr(2, tam);
			if (tam > 4 && tam < 11)
			campo.value = s.substr(0,2) + '/' + s.substr(2,2) + '/' + s.substr(4,tam-4); 
			break;
			case 'CEP' :
			if (tam > 5 && tam < 7)
			campo.value = s.substr(0,5) + '-' + s.substr(5, tam);
			break; 
			case 'HORA' :
			if (tam > 2 && tam < 4)
			campo.value = s.substr(0,2) + ':' + s.substr(2, tam);
			if (tam > 4 && tam < 11)
			campo.value = s.substr(0,2) + ':' + s.substr(2,2) + ':' + s.substr(4,tam-4);
			break;
			}
			}}
			//--->Função para verificar se o valor digitado é número...<---
			function digitos(event){
				if (window.event) {
					// IE                
					key = event.keyCode;    
					}
					else if ( event.which ) {
						// netscape
						key = event.which;        } 
						if ( key != 8 || key != 13 || key < 48 || key > 57 ) 
						return 
						( 
						 (
						  ( 
						   key > 47 ) && ( key < 58 ) ) || ( key == 8 ) || ( key == 13 ) );
						return true;}
function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}

<!--
function validar(form) { 

cliente = document.formulario.cliente.value; // verifica o campo nome
if (cliente == "") { // verifica se o campo nome está vazio
alert("Coloque o nome do Cliente"); // mensagem exibida se o campo não for preenchido
formulario.cliente.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
} // aqui termina a parte para nome

endereco = document.formulario.endereco.value; // verifica o campo e-mail
if (endereco == "") {
alert("Coloque o Endereço");
formulario.endereco.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}

bairro = document.formulario.bairro.value; // verifica o campo numero
if (bairro == "") {
alert("Coloque o Bairro");
formulario.bairro.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
cep = document.formulario.cep.value;
if (cep == "") {
alert("Coloque o CEP");
formulario.cep.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
cidade = document.formulario.cidade.value;
if (cidade == "") {
alert("Coloque a Cidade");
formulario.cidade.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
uf = document.formulario.uf.value;
if (uf == "") {
alert("Coloque a UF");
formulario.uf.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
rg = document.formulario.rg.value;
if (rg == "") {
alert("Coloque o RG");
formulario.rg.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
cpf = document.formulario.cpf.value; // verifica o campo e-mail
if (cpf == "") {
alert("Coloque o CPF");
formulario.cpf.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
cod_prod_1 = document.formulario.cod_prod_1.value;
if (cod_prod_1 == "") {
alert("Coloque o Codigo do Produto");
formulario.cod_prod_1.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
desc_prod_1 = document.formulario.desc_prod_1.value;
if (desc_prod_1 == "") {
alert("Coloque a Descrição do do Produto");
formulario.desc_prod_1.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
qtde_1 = document.formulario.qtde_1.value;
if (qtde_1 == "") {
alert("Coloque a Quantidade");
formulario.qtde_1.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
valor_1 = document.formulario.valor_1.value;
if (valor_1 == "") {
alert("Coloque o Valor");
formulario.valor_1.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
loja_origem = document.formulario.loja_origem.value;
if (loja_origem =="") {
alert("Coloque a Loja de Origem");
formulario.loja_origem.focus(); // coloque esse linha no script fazendo referência ao formulário e ao campo com foco //
return false;
}
}
// -->
function autoTab(input, e)  { 
  var ind = 0;
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var nKeyCode = e.keyCode; 
  if(keyCode == 13){ 
    if (!isNN) {window.event.keyCode = 0;} // evitar o beep
    ind = getIndex(input);
    if (input.form[ind].type == 'textarea') {
      return;
    }
    ind++;
    input.form[ind].focus(); 
    if (input.form[ind].type == 'text') {
      input.form[ind].select(); 
    }
  } 

  function getIndex(input) { 
    var index = -1, i = 0, found = false; 
    while (i < input.form.length && index == -1) 
      if (input.form[i] == input) {
        index = i;
          if (i < (input.form.length -1)) {
           if (input.form[i+1].type == 'hidden') {
       index++; 
     }
     if (input.form[i+1].type == 'button' && input.form[i+1].id == 'tabstopfalse') {
       index++; 
     }
   }
      }
      else 
   i++; 
    return index; 
  }
}

function MascaraMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){
    var sep = 0;
    var key = '';
    var i = j = 0;
    var len = len2 = 0;
    var strCheck = '0123456789';
    var aux = aux2 = '';
    var whichCode = (window.Event) ? e.which : e.keyCode;
    if (whichCode == 13) return true;
    key = String.fromCharCode(whichCode); // Valor para o código da Chave
    if (strCheck.indexOf(key) == -1) return false; // Chave inválida
    len = objTextBox.value.length;
    for(i = 0; i < len; i++)
        if ((objTextBox.value.charAt(i) != '0') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break;
    aux = '';
    for(; i < len; i++)
        if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i);
    aux += key;
    len = aux.length;
    if (len == 0) objTextBox.value = '';
    if (len == 1) objTextBox.value = '0'+ SeparadorDecimal + '0' + aux;
    if (len == 2) objTextBox.value = '0'+ SeparadorDecimal + aux;
    if (len > 2) {
        aux2 = '';
        for (j = 0, i = len - 3; i >= 0; i--) {
            if (j == 3) {
                aux2 += SeparadorMilesimo;
                j = 0;
            }
            aux2 += aux.charAt(i);
            j++;
        }
        objTextBox.value = '';
        len2 = aux2.length;
        for (i = len2 - 1; i >= 0; i--)
        objTextBox.value += aux2.charAt(i);
        objTextBox.value += SeparadorDecimal + aux.substr(len - 2, len);
    }
    return false;
}


</script>


</head>


<link href="../seg_asp/css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style><table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="Painel"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="40"><table width="100%" border="0" cellspacing="1" cellpadding="0">
          <tr>
            <td width="25%" rowspan="2"> </td>
            <td width="14%" height="20"><a href="http://www.hbf.com.br" target="_blank" class="legendaBr"  style="text-decoration:none">SITE</a></td>
            <td width="14%"><a href="http://www.handbookfashion.com.br"  target="_blank" class="legendaBr"  style="text-decoration:none">BLOG</a></td>
            <td width="12%"><a href="http://www.meuip.com.br"  target="_blank" class="legendaBr"  style="text-decoration:none">MEU IP 1 </a></td>
            <td width="10%"><a href="http://www.minhaconexao.com.br"   target="_blank" class="legendaBr"  style="text-decoration:none">MEU IP 2</a> </td>
            <td width="25%" class="legendaBr" style="text-decoration:none" >TELEFONES UTÉIS</td>
          </tr>
          <tr>
            <td valign="top"><a href="http://200.171.33.90/dskv/"  target="_blank" class="legendaBr"  style="text-decoration:none">E-MAIL 1</a></td>
            <td valign="top"><a href="http://201.6.155.24/dskv/"  target="_blank" class="legendaBr"  style="text-decoration:none">E-MAIL 2</a></td>
            <td valign="top"><a href="http://www.serasa.com.br"  target="_blank" class="legendaBr"  style="text-decoration:none">SERASA</a></td>
            <td> </td>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="24%"> </td>
                <td width="67%"><div align="right"><a href="../admmor/login_skip.asp" class="legenda"><strong>Sair</strong></a></div></td>
                <td width="9%"> </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="35"> </td>
      </tr>
      <tr>
        <td height="624" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="10"></td>
            </tr>
        </table>
              
                <table width="720" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="614"><form action="upload_form_troca.asp" method="post" name="formulario"  onSubmit="return validar(this)">
                        <table width="720" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td align="left" valign="top"><table width="720" border="0" align="left" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="640" height="16" valign="top"><div align="center" class="TITULO"> TROCA DE MERCADORIAS</div></td>
                                </tr>

                            </table></td>
                          </tr>
                        </table>
                      <hr align="center" width="600" size="1" color="#CCCCCC" />
                        <table width="720" border="0" cellspacing="0" cellpadding="1">
                          <tr>
                            <td width="2"> </td>
                            <td bgcolor="#D7D9DF" class="legenda"><strong>NOME</strong></td>
                            <td height="30" colspan="4" bgcolor="#D7D9DF" class="legenda"><input name="cliente" type="text" id="cliente" size="75" maxlength="50" style="text-transform:capitalize"  onkeypress ="autoTab(this, event);" /></td>
                          </tr>
                          <tr>
                            <td> </td>
                            <td bgcolor="#D7D9DF" class="legenda"><strong>ENDEREÇO</strong></td>
                            <td height="30" colspan="4" bgcolor="#D7D9DF" class="legenda"><input name="endereco" type="text" id="endereco" size="92" maxlength="50" style="text-transform:capitalize"  onkeypress ="autoTab(this, event);"/></td>
                          </tr>
                          <tr>
                            <td> </td>
                            <td height="30" colspan="5" bgcolor="#D7D9DF" class="legenda"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="66" height="30" class="legenda"><strong class="legenda">BAIRRO</strong></td>
                                  <td width="456"><input name="bairro" type="text" id="bairro" size="70" maxlength="60" style="text-transform:capitalize"   onkeypress ="autoTab(this, event);"  /></td>
                                  <td width="40"><strong class="legenda">CEP</strong></td>
                                  <td width="152"><input name="cep" type="text" id="cep"  onkeypress="autoTab(this, event); return SomenteNumero(event)" onkeyup="Mascara('CEP',this,event);" size="9" maxlength="9" /></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td> </td>
                            <td width="65" height="30" bgcolor="#D7D9DF" class="legenda"><strong>CIDADE</strong></td>
                            <td width="481" bgcolor="#D7D9DF" class="legenda"><input name="cidade" type="text" id="cidade" size="70" maxlength="50" style="text-transform:capitalize"  onkeypress ="autoTab(this, event);" /></td>
                            <td width="37" align="center" bgcolor="#D7D9DF" class="legenda"><strong class="legenda">UF</strong></td>
                            <td width="56" height="30" align="right" bgcolor="#D7D9DF" class="legenda"><input name="uf" type="text" id="uf" onkeypress="autoTab(this, event);" onkeyup="Mascara('CEP',this,event);" size="5" maxlength="2" style="text-transform:uppercase"/></td>
                            <td width="67" bgcolor="#D7D9DF" class="legenda"> </td>
                          </tr>
                          <tr>
                            <td> </td>
                            <td height="30" colspan="5" bgcolor="#D7D9DF" class="legenda"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="68" height="30" class="legenda"><strong>RG</strong></td>
                                  <td width="224"><input name="rg" type="text" id="rg" onkeypress="autoTab(this, event);" onkeyup="Mascara('RG',this,event);" size="30" maxlength="12" style="text-transform:uppercase"/></td>
                                  <td width="28"><strong class="legenda">CPF</strong></td>
                                  <td width="394"><input name="cpf" type="text" id="cpf" onkeypress="autoTab(this, event); return SomenteNumero(event)" onkeyup="Mascara('CPF',this,event);" size="30" maxlength="14" /></td>
                                </tr>
                            </table></td>
                          </tr>
                        </table>
<hr align="center" width="600" size="1" color="#CCCCCC" />
                        <table width="720" border="0" align="left" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="12" bgcolor="#D7D9DF"> </td>
                            <td width="96" height="30" bgcolor="#D7D9DF" class="legenda"><div align="center"><strong>CODIGO</strong></div></td>
                            <td width="415" bgcolor="#D7D9DF" class="legenda"><strong>DESCRIÇÃO</strong></td>
                            <td width="100" align="left" bgcolor="#D7D9DF" class="legenda"><div align="center"><strong>QUANTIDADE </strong></div></td>
                            <td width="97" bgcolor="#D7D9DF" class="legenda"><div align="center"><strong>VALOR</strong></div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                            <input name="cod_prod_1" type="text" id="cod_prod_1" onkeypress="autoTab(this, event);"  size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF">
                            <input name="desc_prod_1" type="text" id="desc_prod_1"   onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                                <input name="qtde_1" type="text" id="qtde_1" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_1" type="text" id="valor_1" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_2" type="text" id="cod_prod_2"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_2" type="text" id="desc_prod_2"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_2" type="text" id="qtde_2" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_2" type="text" id="valor_2" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_3" type="text" id="cod_prod_3"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_3" type="text" id="desc_prod_3"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_3" type="text" id="qtde_3" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_3" type="text" id="valor_3" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_4" type="text" id="cod_prod_4"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_4" type="text" id="desc_prod_4"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_4" type="text" id="qtde_4" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_4" type="text" id="valor_4" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_5" type="text" id="cod_prod_5"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_5" type="text" id="desc_prod_5"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_5" type="text" id="qtde_5" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_5" type="text" id="valor_5" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_6" type="text" id="cod_prod_6"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_6" type="text" id="desc_prod_6"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_6" type="text" id="qtde_6" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_6" type="text" id="valor_6" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_7" type="text" id="cod_prod_7"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_7" type="text" id="desc_prod_7"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_7" type="text" id="qtde_7" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_7" type="text" id="valor_7" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td bgcolor="#D7D9DF"> </td>
                            <td height="30" bgcolor="#D7D9DF" class="FormTxt"><div align="center">
                                <input name="cod_prod_8" type="text" id="cod_prod_8"  onkeypress="autoTab(this, event);" size="10" maxlength="5" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><input name="desc_prod_8" type="text" id="desc_prod_8"  onkeypress="autoTab(this, event);" size="65" maxlength="60" style="text-transform:capitalize"  /></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="qtde_8" type="text" id="qtde_8" onkeypress="autoTab(this, event); return SomenteNumero(event)" size="10" maxlength="6" />
                            </div></td>
                            <td bgcolor="#D7D9DF"><div align="center" >
                              <input name="valor_8" type="text" id="valor_8" size="10" maxlength="6" onkeypress="autoTab(this, event); return(MascaraMoeda(this,'.',',',event)) "  />
                            </div></td>
                          </tr>
                          <tr>
                            <td height="10" colspan="5"></td>
                          </tr>
                          <tr>
                            <td height="22" bgcolor="#CCCCCC"> </td>
                            <td height="50" colspan="4" bgcolor="#CCCCCC" class="FormTxt"><table width="100%" border="0" cellspacing="2" cellpadding="0">
                                <tr>
                                  <td width="17%" height="50" class="legenda"><strong>Nº Cupom Fiscal </strong></td>
                                  <td width="15%"><input name="n_cupom_fiscal" type="text" id="n_cupom_fiscal"  onkeypress="autoTab(this, event);" size="10" maxlength="10" /></td>
                                  <td width="15%" class="legenda"><strong>Data do Cupom </strong></td>
                                  <td width="17%"><input name="dt_cupom" type="text" id="dt_cupom"  onkeypress="autoTab(this, event);" size="10" maxlength="10" /></td>
                                  <td width="12%" class="legenda"><strong>Loja Origem </strong></td>
                                  <td width="24%"><input name="loja_origem" type="text" id="loja_origem"  onkeypress="autoTab(this, event);" size="20" maxlength="20" style="text-transform:capitalize"  /></td>
                                </tr>
                            </table></td>
                          </tr>
                        </table>
              <br />
                        <br />
                        <br />
                      <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="24"><div align="center">
                                <input type="submit" name="Enviar" value="Enviar" />
                                <input name="limpar" type="reset" id="limpar" value="Limpar" />
                            </div></td>
                          </tr>
                        </table>
                    </form></td>
                  </tr>
                </table>
</td>
      </tr>
    </table></td>
  </tr>
</table>
<br />
<br />

 

Se alguem puder me ajudar eu agradeço...

 

Obrigado....

Compartilhar este post


Link para o post
Compartilhar em outros sites

Faz o seguinte no inicio do código function Mascara(tipo, campo, teclaPress) {

veja se a tecla aperta é o espaço caso sim alert() e naõ executa a função.

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.