Ir para conteúdo

Arquivado

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

wanderson.PHW

Validação input e-mail não esta validando, só cria um alerta

Recommended Posts

estou com um formulário que fica dentro de um iframe mas não to conseguindo validar o input de email

 

segue o a pagina do formulario:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<head>
<title></title>

<%
session("dados_ok") = "S"
%>
<style type="text/css">
<!--




<style type="text/css">

 
*{
 text-decoration:none;
 }
<!--
</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td img {display: block;}.style1 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
}
.style2 {	font-size: 24px;
	color: #003366;
}
.style6 {font-size: 9px}
</style>




<style type="text/css">
td img {display: block;}body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.style2 {font-size: 10px}
.style7 {color: #000000}
.style13 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 13px;
	color: #003366;
}
.style14 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; font-weight: bold; }
.style19 {
	color: #FF0000;
	font-size: 11px;
}
.style20 {color: #666666}
.style22 {color: #003366}
</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body width="361" height=" 100">
<center>
<table width="361" border="0" cellpadding="0" cellspacing="0" bordercolor="#575757" bgcolor="" style="display: inline-table;">
<!-- fwtable fwsrc="art.fw.png" fwpage="Página 1" fwbase="art.jpg" fwstyle="Dreamweaver" fwdocid = "1962855546" fwnested="0" -->
 
   <table width="361" height="250" border="0" bgcolor="#FFFFFF">
  <tr>
    <td height="150" colspan="0" valign="top"><div align="justify">
      <p class="style1"><font size="2" face="Verdana"><font color="#003366"><a name="formulario" id="formulario"></a>
            <script language="JavaScript" type="text/javascript">

<!--

function validar(theForm)
{

  // Verifica se o campo E-mail está preenchido

  if (theForm.email.value == "")

  {

    alert("Favor preencher o campo \"e-mail\".");

    theForm.email.focus();

    return (false);

  }



}		

//-->

                    </script>
<script language=javascript> 
function confere(){
if (document.theForm.email.value.indexOf('@', 0) == -1 || document.theForm.email.value.indexOf('.', 0) == -1){ alert("E-mail invalido!");
	return false;
	}
}  
function is_email(email){
	er = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2}/; 
	if( !er.exec(email) )
	{
		jQuery('#retorno_capta').html('Email inválido!');
		return false;
	}
}
</script> 
<script type="text/javascript">

  var backup = new Array

  function check_alpha(val,name) {
	var goodChars = "0123456789abcdefghijklmnopqrstuxywvzABCDEFGHIJKLMNOPQRSTUVWXYZ"
 	var errors = 0
	var isOk = 1
	for(var i=0;i<val.length;i++) {
		isOk = 1
		for(var j=0;j<goodChars.length;j++) {
			if(goodChars.charAt(j) == val.charAt(i)) {
          			isOk = 0
       			}	
      		}
      		if(isOk == 1) {
			errors++
			break;
      		}
    	}
		
	if(errors > 0) {
		if(backup[name]) {
			document.getElementById(name).value = backup[name]
		}
		else {
			document.getElementById(name).value = ""
		}
	}
	else {
		backup[name] = val
	}
	
  }

</script>
			
            <font color="#003366"><a name="formulario" id="formulario"></a></font><font size="2" face="Verdana">
            <style>

.form {font-size: 11px; font-family: Tahoma; color: #333333; background-color: #E3E3E3; border: #666666 1px double;}
.botao {font-size: 11px; font-family: Tahoma; color: #333333;}

                    </style>
            </font></font></font><font color="#003366" size="2" face="Verdana, Arial, Helvetica, sans-serif">
      <input type="hidden" name="subject" value="Cadastro" />
      <input type="hidden" name="recipient" value="email destinatario" />
      <input type="hidden" name="redirect" value="http://pagina de destino.com.br" />
            </font>      </p>
      <p align="center" class="style1"> </p>
    </div>
	<form action="enviar_mensagem.asp?sessao=<%=session("dados_ok")%>" name="theForm" method="post" align="center" onSubmit="return
validaForm()">
      <center>
        <p class="style14"> </p>
      </center>
	
	<table width="361" border="0" align="center" cellpadding="0" cellspacing="4">
      <tr>
        <td align="right"><span class="style13">Nome<span class="style19">*</span>:</span></td>
        <td align="left"><font size="2" face="Verdana">
          <input name="nome" type="nome" class="form" id="nome" size="35" maxlength="60" required="required" onChange="check_alpha(this.value,this.id)" onKeyUp="check_alpha(this.value,this.id)">
        </font></td>
      </tr>
      <tr>
        <td width="30%" align="right" valign="top"><div align="right"><span class="style22"><font face="Verdana" size="2">E-mail</font></span><span class="style19">*</span><font face="Verdana" size="2">:</font></div></td>
		
		        <td width="70%" align="left"><font size="2" face="Verdana">
          <input  name="email" type="email" class="form" id="email" size="35" required="required" maxlength="60" onblur="confere()" onkeyup="this.value = this.value.toLowerCase();" />
          <br />
                </font><font face="Verdana"><span class="style2 style7"><span class="style2 style20"><span class="style6">(Digite um e-mail válido)</span></span></span></font> </td>
      </tr>
      <tr>
        <td width="30%" align="right" valign="top"><div align="right"><span class="style22"><font size="2" face="Verdana">Cadastre uma senha</font></span><span class="style19">*</span><font size="2" face="Verdana">:</font></div></td>
        <td width="70%" align="left"><font size="2" face="Verdana">
          <input name="senha" type="password" class="form" id="senha" size="35" maxlength="60" required="required" onChange="check_alpha(this.value,this.id)" onKeyUp="check_alpha(this.value,this.id)">
          <br />
        </font><font face="Verdana"><span class="style2 style7"><span class="style2 style20"><span class="style6">(Digite uma senha com letras e números)</span></span></span></font></td>
      </tr>
      <tr>
        <td width="30%" height="35"> </td>
        <td width="70%" align="left" valign="bottom"><font size="2" face="Verdana">
          <input name="submit" type="submit" class="botao" onmouseover="window.status='Certifique-se que as informações estão corretas, e aperte o botão para envia-las';return false" onmouseout="window.status=('Tecnologia, Wanderson!')" value="Enviar" Onclick="JavaScript:parent.location='form.asp'" />
            
          <input name="submit" type="submit" class="botao" onmouseover="window.status='Certifique-se que as informações estão corretas, e aperte o botão para envia-las';return false" onmouseout="window.status=('Tecnologia, Wanderson!')" value="Já sou cadastrado" Onclick="JavaScript:parent.location='form.asp'"/>
        </font></td>
      </tr>
    </table>
</body>
</form>


</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por juniormatrix
      Olá
       
      Achei esse script aqui no fórum mesmo:
       
      $.validator.addMethod( "customEmail", function (value, element) { return this.optional(element) || /^[\w-\.]+@fulano\.com\.br$/i.test(value); }, "Por favor, insira um e-mail válido com o domínio @fulano.com.br" ); $("#formulario").validate({ ignore: ".ignore", rules: { empresa: { required: true }, nome: { required: true }, contato: { required: true }, celular: { required: true }, email: { required: true, email: true, customEmail: true }, }, }); Testei e funcionou perfeitamente, mas gostaria que liberasse mais e-mails válidos, ao invés de apenas um.

      Tem como fazer? 
       
      Se alguém puder ajudar, fico muito grato.
    • Por luiz0o
      Estou fazendo um projeto para faculdade, e tenho um formulário, esse formulário precisa enviar as respostas tanto para um banco de dados, mas também tem que enviar para uma API que envia para meu email, mas não sei como fazer essas duas coisas ao mesmo tempo
    • Por estanieski_poa
      Estou com um sistema antigo, desenvolvido em Delphi 7+Oracle10g.
       
      O sistema funciona corretamente, mas ele começou a ficar solcititando usuário e senha do Oracle quando realizo pesquisar ou inserções no sistema.
       
      Como desativo essa solicitação?
    • Por GOD
      Quero pegar o dado:
      CHEGADA e SAÍDA do form 1 e colocar para ser exibido no campo;
      DATAS DA ESTADIA no form 2.
      e
      ADULTO E CRIANÇA também do form 1 para o form 2
      Como faço isso sem utilizar banco de dado. Se possível somente com html, css. E se não for possível pode entrar o Javascript ou como possível for. 
       
      Desde já agradeço. 
       
       
      Form 1
       
       
      <!DOCTYPE html> <html> <head> <!---------------------------------- FORMULARIO 1 ------------------------------------------------> <form class="reserva-form" action="" method="post"> <fieldset class="fiesdeset"> <div class="reserva-form-chegada"> <label class="reserva-form-chegada-label">Chegada ↴</label> <br /> <input type="date" /> </div> <div class="reserva-form-saida"> <label class="reserva-form-saida-label">Saida ↴</label> <br /> <input type="date" /> </div> <div class="reserva-form-adulto"> <label class="inicio" style="margin: 0">Adultos</label> <select name="ad" id="adultos"> <option value="1" selected="">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </div> <div class="reserva-form-crianca"> <label class="inicio" style="margin: 0">Crianças</label> <select name="ch" id="nCrianca"> <option value="0" selected="selected">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </div> <div class="reserva-form-pesquisar"> <button type="submit" class="botao-pesquisar type=" submit" id="bt-pesquisa" data-enabled="enabled"> Pesquisar </button> </div> <div class="reserva-form-check-in"> <a href="form-cadastro.html" class="botao-checkin" target="_blank">Pré-checkin</a> </div> </fieldset> </form> </body> </html>  
       
      Form 2
       
       
      <!DOCTYPE html> <html> <head> <!------------------------------ FORMULARIO 2 ---------------------------------------------------> <form class="reserva-form" action="" method="post"> <fieldset class="fiesdeset"> <div class="reserva-form-estadia"> <label class="reserva-form-estadia-label">DATAS DA ESTADIA ↴</label> <br /> <input type="text" name="estadia" value="10/06/2022 - 10/07/2022" /> </div> <div class="reserva-form-quarto"> <label class="reserva-form-quarto-label">   QUARTOS E HÓSPEDES ↴</label> <br> <label class="inicio">  Nº de Quartos</label> <select name="ad" id="quarto"> <option value="1" selected="">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </div> <div class="reserva-form-adulto"> <label class="inicio">Adultos</label> <select name="ad" id="adultos"> <option value="1" selected="">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </div> <div class="reserva-form-crianca"> <label class="inicio" style="margin: 0">Crianças</label> <select name="ch" id="nCrianca"> <option value="0" selected="selected">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </div> <div class="reserva-form-crianca"> <label class="inicio">&nbsp Nº de Crianças 0 aos 12 Anos</label> <select name="ch" id="nCrianca"> <option value="0" selected="selected">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </div> <div class="reserva-form-pesquisar"> <button type="submit" class="botao-pesquisar type=" submit" id="bt-pesquisa" data-enabled="enabled"> Buscar </button> </div> </fieldset> </form> </body> </html>  
    • Por 4Unknow
      Boa tarde amigos.
      Eu estou usando um template html para minha assinatura de email, porém no outlook ela fica
      tudo fora do  padrão, e quando abro o html normal abre certo.

      Olhem só, quando está no outrlook:

       
       
      ela normal seria assim:
       

       
      Segue o código da assinatura que estou usando:
       
      <html> <br> <br> <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head> <body><div class="wrapper" style=" width: 100%; min-height: 217px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 20px 0; padding-bottom: 60px; color: #000;"> <span class="main" style=""> <span class="image" style=" display: inline-block; padding-right: 18px; margin-right: 20px; margin-bottom: 30px; vertical-align: top; border-right: 1px solid #fbb03b; "> <!-- YOUR PICTURE --> <img src="https://i.imgur.com/Oxal8FD.png" nosend="1" alt="Leonardo V. Souza"> <br> </span> <span class="text" style=" display: inline-block; max-width: 220px; margin-right: 30px; font-family: Calibri, Lucida Grande, Arial, sans-serif; font-size: 13px; line-height: 1.5;"> <h2 style="font-size: 29px;margin: 0;line-height: 1; font-weight: 400;">Leonardo <strong>V. Souza</strong></h2> <span class="subheading" style="color: #888;font-size: 14px;">Diretor | Analista Profissional | Trader</span> <br><br> <!-- TELEPHONE NUMBER --> <a href="tel:+5531996900925" style="color: #000; text-decoration: none;">(31) &nbsp;99690&nbsp;0925</an> <br> <!-- WEBSITE --> <a href="https://somosviva.com" target="_blank" title="somosviva.com" style="color: #000; text-decoration: none;">www.somosviva.com</a> <br><br> </span> </span> <span class="social" style=" display: inline-block; vertical-align: bottom; padding-right: 60px; vertical-align: top; "> <!-- Adjust LOGO offset here --> <div class="separator" style="height: 6px;"></div> <!-- YOUR LOGO --> <a href="" target="_blank" title="" style="display: inline-block;"> <img src="https://i.imgur.com/opBSoJt.png" nosend="1" alt="Logo " style="vertical-align: middle;"> </a> <br><br> <!-- SOCIAL LINKS --> <a href="https://www.facebook.com/somostodosviva" nosend="1" target="_blank" title="Facebook" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="https://i.imgur.com/HB9pAIC.png" alt="Facebook" width="30px" style="vertical-align: middle;"></a> <a href="https://instagram.com/somostodosviva" nosend="1" target="_blank" title="Instagram" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="https://i.imgur.com/UEMvOEH.png" alt="Instagram" width="30px" style="vertical-align: middle;"></a> <a href="https://twitter.com/somosviva1" nosend="1" target="_blank" title="Instagram" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="https://i.imgur.com/kV8bGWD.png" alt="Twitter" width="30px" style="vertical-align: middle;"></a> <!-- <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_codepen.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_drive.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_dropbox.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_github.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_google-plus.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_skype.png" alt="" width="30px" style="vertical-align: middle;"></a> <a href="" nosend="1" target="_blank" title="" style="display: inline-block;border: 1px solid #ddd;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 7px;margin-top: 4px;"> <img src="icon/icon_yt.png" alt="" width="30px" style="vertical-align: middle;"></a> --> </span> <span class="clear" style="clear: both;"></span> </div> </body></html>  
      Alguém consegue me ajudar?
      Obrigado.
×

Informação importante

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