Ir para conteúdo
Fórum Script Brasil

PERNAMBUCO_FJV

Membros
  • Total de itens

    413
  • Registro em

  • Última visita

Tudo que PERNAMBUCO_FJV postou

  1. tem como eu ver se um certo botão foi precionado?? ex: document.form.n1.pressed isso ae em cima não existe,queria saber se existe algo assim!!
  2. Dentro doque eu entendi: <html> <script language="JavaScript"> function Verifica_Pontos(){ var ponto=0; for(x=0;x<document.form.n1.value.length;x++){ valor=document.form.n1.value.charAt(x); if(valor==".") ponto+=1; } if(ponto!=3){ alert("erro"); document.form.n1.value=""; document.form.n1.focus(); } else document.form.submit(); } </script> <body> <form name="form" action="#" method="post"> <input type="text" name="n1"> <input type="button" Value="Checar" onclick="Verifica_Pontos()"> </form> </body> </html>
  3. Vê só: tem uma tabela: com campos A B C,sendo que cada letra é uma coluna!! em cada coluna tem valores... ... ex: Coluna A Coluna B Coluna C 100 200 300 100 200 300 100 200 300 Gostaria de somar os campos apena da da Coluna A,ou seja, somar 100 + 100 + 100,que no caso da 300... ...então na linha de baixo,nessa mesma coluna (Coluna A) aperecer o resultado:
  4. Ae galera,me deem um help por favor... ...tem como eu pegar todos os elementos de uma tabela e soma-los?? ex: vamos supor que isso está separado por celulas: Valor1 valor2 100 200 100 200 media 200 400 ou seja,somar cada coluna!!
  5. tem como fazer assim: tem um select de 1 a 12 (Mês) caso escolham meses que não tem 31 dias,carregar em outro select apenas os dias que aquele mes possui. ex: um select de 1 a 12,se escolher 4, o select de dias carrega apenas de 1 a 30 e assim vai
  6. Fiz uma validação simples,ainda falta alguma coisa,ai você desenrola,ok?? <html> <script language="JavaScript"> function validar_campos(){ array=["nome","endereco","cep","cidade","E-mail","ddd","telefone","fax","mensagem"]; for(x=0;x<document.form1.elements.length; x++){ if(document.form1.elements[x].type=="text"){ if(document.form1.elements[x].value==""){ alert("Campo : " + array[x] + " não pode ser vazio"); document.form1.elements[x].focus(); return false; } } } if (document.form1.email.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) { alert("E-mail inválido"); document.form1.email.value=""; document.form1.email.focus(); return false; } return true; } function valida_numero(){ if(event.keyCode<48 || event.keyCode>57) event.returnValue=false } function valida_cep(edit){ if(event.keyCode<48 || event.keyCode>57) event.returnValue=false if(edit.value.length==5) edit.value+="-"; } </script> <body> <form method="POST" action="envia.asp" name="form1" onsubmit="return validar_campos()"> <table width="484"> <tr> <td width="52">Nome:</td> <td width="424"> <input type="text" size="59" maxlength="30" name="nome" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Endereço:</td> <td width="424"> <input type="text" size="59" maxlength="50" name="endereco" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Cep.:</td> <td width="424"> <input type="text" size="22" maxlength="9" name="cep" onKeyPress="valida_cep(this)" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Cidade:</td> <td width="424"> <input type="text" size="40" maxlength="15" name="cidade" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Estado:</td> <td width="424"> <select name="estado" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> <option value="AM">AM</option> <option value="AP">AP</option> <option value="AL">AL</option> <option value="BA">BA</option> <option value="CE">CE</option> <option value="DF">DF</option> <option value="ES">ES</option> <option value="GO">GO</option> <option value="MA">MA</option> <option value="MT">MT</option> <option value="MS">MS</option> <option value="MG">MG</option> <option value="PA">PA</option> <option value="PB">PB</option> <option value="PR">PR</option> <option value="PE">PE</option> <option value="PI">PI</option> <option value="RJ">RJ</option> <option value="RN">RN</option> <option value="RO">RO</option> <option value="RR">RR</option> <option value="RS">RS</option> <option value="SC">SC</option> <option value="SP">SP</option> <option value="SE">SE</option> <option value="TO">TO</option> </select> </td> </tr> <tr> <td width="52">Email:</td> <td width="424"> <input type="text" size="59" maxlength="20" name="email" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">DDD:</td> <td width="424"> <input type="text" size="9" maxlength="3" name="ddd" onKeyPress="valida_numero()" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Telefone:</td> <td width="424"> <input type="text" size="25" maxlength="12" name="telefone" onKeyPress="valida_numero()" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td width="52">Fax:</td> <td width="424"> <input type="text" size="25" maxlength="12" name="fax" onKeyPress="valida_numero()" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </td> </tr> <tr> <td colspan="2"><div align="center">Mensagem: </div></td> </tr> <tr> <td colspan="2"><div align="center"><textarea name="mensagem" rows="15" cols="62" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"></textarea></td> </tr> </table> </dd> <dd>&nbsp;</dd> <dd> <input type="submit" value="ENVIAR" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> <input type="reset" value="Limpar dados" style="font-size: 11 px; font-family: Tahoma; border-style: solid; border-width: 1"> </dd> </dl> </form> </body> </html>
  7. Valeu!! você me deu uma idéia massa e simples!! function cancelar(){ document.form.reset(); }
  8. como eu faço para uma image receber todas as propriedades de um input type reset?? ou seja,quando eu apertar na image,executar como se fosse um input type="reset"
  9. Tinha um BUG... ...aceitava 30 de fevereiro <html> <script language="JavaScript"> <!-- function valida_data(){ if(event.keyCode<48 || event.keyCode>57) event.returnValue=false; if(document.form.data.value.length==2 || document.form.data.value.length==5) document.form.data.value+="/" } function maxlength(){ array_mes=["02","04","06","09","11"]; erro= "Data Inválida" dia=document.form.data.value.charAt(0)+document.form.data.value.charAt(1); mes=document.form.data.value.charAt(3)+document.form.data.value.charAt(4); year=document.form.data.value.charAt(6)+document.form.data.value.charAt(7)+document.form.data.value.charAt(8)+document.form.data.value.charAt(9); if(document.form.data.value.length<10){ alert(erro); document.form.data.value=""; document.form.data.focus(); return false; } texto=document.form.data.value; if(parseInt(texto.substr(6,10)) % 4==0) ano="bissexto"; else ano=""; if (dia<1 || dia>31 || mes<1 || mes>12){ alert(erro); document.form.data.value=""; document.form.data.focus(); return false; } for(x=0; x<array_mes.length; x++){ if(mes == array_mes[x] && dia>30){ alert(erro) document.form.data.value=""; document.form.data.focus(); return false; } } if (ano!="bissexto" && dia>28 && mes==2){ alert(erro) document.form.data.value=""; document.form.data.focus(); return false; } if (ano=="bissexto" && dia>29 && mes==2){ alert(erro) document.form.data.value=""; document.form.data.focus(); return false; } if (year<1900){ alert(year) document.form.data.value=""; document.form.data.focus(); return false; } } --> </script> <body> <form name="form" action="#" method="post" OnSubmit="return maxlength()"> <input type="text" name="data" maxlength="10" onkeypress="valida_data()"> <input type="submit" value="Validar"> </form> </body> </html>
  10. fiz uma função de validação,ta meio grande,mas funciona... ...testei tudo que lembrei e deu certo... ...se encontrarem bug,me avisem:
  11. Tinha Bug: <html> <script language="JavaScript"> <!-- function valida_data(){ if(event.keyCode<48 || event.keyCode>57) event.returnValue=false; if(document.form.data.value.length==2 || document.form.data.value.length==5) document.form.data.value+="/" } function maxlength(){ mes=["02","04","06","09","11"]; erro= "Data Inválida" if(document.form.data.value.length<10){ alert(erro); document.form.data.value=""; document.form.data.focus(); return false; } texto=document.form.data.value; if(parseInt(texto.substr(6,10)) % 4==0 && parseInt(texto.substr(8,10))!=00) ano="bissexto"; else ano=""; if (document.form.data.value.charAt(0)+document.form.data.value.charAt(1)<1 || document.form.data.value.charAt(0)+document.form.data.value.charAt(1)>31 || document.form.data.value.charAt(3)+document.form.data.value.charAt(4)<1 || document.form.data.value.charAt(3)+document.form.data.value.charAt(4)>12){ alert(erro); document.form.data.value=""; document.form.data.focus(); return false; } for(x=0; x<mes.length; x++){ if(document.form.data.value.charAt(3)+document.form.data.value.charAt(4)==mes[x] && document.form.data.value.charAt(0)+document.form.data.value.charAt(1)>30){ alert(erro) document.form.data.value=""; document.form.data.focus(); return false; } } if (ano!="bissexto" && document.form.data.value.charAt(0)+document.form.data.value.charAt(1)>28 && document.form.data.value.charAt(3)+document.form.data.value.charAt(4)==2){ alert(erro) document.form.data.value=""; document.form.data.focus(); return false; } } --> </script> <body> <form name="form" action="#" method="post" OnSubmit="return maxlength()"> <input type="text" name="data" maxlength="10" onkeypress="valida_data()"> <input type="submit" value="Validar"> </form> </body> </html>
  12. só para dizer,que fui eu quem fiz!! tinha esquecido de logar
  13. QUASE QUE EU CHORO AQUI DE EMOÇÃO!! Um grande amigo meu,fez essa função em 5 minutos e super pequena... ...é para quem pode!! Não pode com ele,junte-se a ele!! O nome dele é Thyago Mendes!! Em baixo vai o código: <html> <script language="JavaScript"> Math.numero = function(n) { var n = n.toString(); if(n.length<=8 && n.indexOf(".")==-1) return true var t = n.substr(0, n.indexOf(".")); if (t.length>8) return false; t = n.substr(n.indexOf(".")+1, n.length-n.lastIndexOf(".")); if (t.length>4) return false; return true; }; function validar(){ if(Math.numero(document.form1.n1.value)) alert("Número Válido") else{ alert("Número Inválido") document.form1.n1.value=""; document.form1.n1.focus(); } } </script> <body> <form name="form1"> <input type="text" name="n1"> <input type="button" value="OK" onclick="validar()"> </form> </body> </html>
  14. <script language="JavaScript"> function valida_data(){ if(event.keyCode<48 || event.keyCode>57) event.returnValue=false; if(data.value.length==2 || data.value.length==5) data.value+="/" } function maxlength(){ if(data.value.length<10){ alert("Data Inválida"); data.value=""; data.focus(); } } </script> Fiz só isso até agora,alguém tem alguma que valide TUDO?? ano bissesto e mais??
  15. Esse aqui nem no google eu consegui!! Ta florida mesmo,mas se alguém souber,me mande,por favor!!
  16. tenho que fazer uma função assim: os numeros são gerados dinamicamente: tem que ta assim: no maximo 8 casas e no maximo 4 casas decimais,ex: 12345678,1234 assim passaria mas se tiver 123456789 o banco não suporta,pois tem mais de 8 casas normais ex: 1,12345 da erro,pois tem mais de 4 casas decimais ou seja,não pode passar de 8 casas normais e nem 4 decimais Desapareceu o que eu coloquei antes??,tava tentando ver e não aparecia,por isso que coloquei denovo,foi mals
  17. VALEU!! acabasse de garantir o meu emprego hehehehe
  18. deu certo!! valeu mesmo!! Aproveitando aqui! tenho uma outra parada no como que separa duas coisas em um mesmo evento??
  19. <img src="botoes/ok.gif" onMouseOver="imagem1" onMouseOut="imagem2"> Tem como eu fazer isso?? Sem ser pelo dreamweaver? que bota uns códigos enormes?? Ex: quando eu colocar o mouse em cima,a imagem muda e quando eu tirar,muda denovo VALEU!!
  20. tem como em um submit de um form em um frame,submeter o outro frame Ex: pagina1.htm => tem um submit,quando eu apertar nesse submit,submeter ao form do outro frame,por exemplo a pagina2.htm
  21. valeu!! mas saco nada de PHP,nem de ASP qual é o mais fácil de aprender dos dois?? onde eu encontro um manual??
  22. tem como ler um arquivo .txt?? Ex: um .txt tem a palavra "oi" eu leio esse .txt e jogo na tela o conteudo do .txt,no caso a palavra "oi" tem como??
×
×
  • Criar Novo...