<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Programação em ASP &#187; email</title>
	<atom:link href="http://quantodaniel.wordpress.com/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://quantodaniel.wordpress.com</link>
	<description>Estudando como programar!</description>
	<lastBuildDate>Sun, 02 Aug 2009 06:37:57 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='quantodaniel.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/bfc920e28461661a78837d8e9ef12218?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Programação em ASP &#187; email</title>
		<link>http://quantodaniel.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://quantodaniel.wordpress.com/osd.xml" title="Programação em ASP" />
		<item>
		<title>Validar Email com JavaScript</title>
		<link>http://quantodaniel.wordpress.com/2007/11/05/validar-email-com-javascript/</link>
		<comments>http://quantodaniel.wordpress.com/2007/11/05/validar-email-com-javascript/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 14:12:21 +0000</pubDate>
		<dc:creator>quantodaniel</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[validação]]></category>
		<category><![CDATA[Validar]]></category>

		<guid isPermaLink="false">http://quantodaniel.wordpress.com/2007/11/05/validar-email-com-javascript/</guid>
		<description><![CDATA[Olá, temos muitas maneiras para validar um campo com JavaScript, vamos tratar agora o campo de Email.
Vou utilizar da maneira mais simples conhecida por um programador, que é  obrigar o usuário digitar ao menos os caracteres: &#8220;@&#8221; e &#8220;.&#8221;

Crie uma página de teste e um formulário, este aqui é simples:
&#60;form action="teste.asp" method="post" id="form" name="form"&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quantodaniel.wordpress.com&blog=2059213&post=5&subd=quantodaniel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Olá, temos muitas maneiras para validar um campo com JavaScript, vamos tratar agora o campo de Email.</p>
<p>Vou utilizar da maneira mais simples conhecida por um programador, que é  obrigar o usuário digitar ao menos os caracteres: &#8220;@&#8221; e &#8220;.&#8221;</p>
<ol>
<li>Crie uma página de teste e um formulário, este aqui é simples:
<pre><font color="#ff9900">&lt;form action="teste.asp" method="post" id="form" name="form"&gt; </font>
	&lt;input type="text" name="nome"  /&gt;
	&lt;input type="text" name="email"  /&gt;
	&lt;input type="button" name="botao" value="Enviar" onClick="valida()"&gt;
<font color="#ff9900">&lt;/form&gt;</font></pre>
</li>
<li>Crie a função&#8221;valida()&#8221;.</li>
<li>Vamos utilizar &#8220;indexOf&#8221;, isso faz com que seja feita uma busca no campo procurando o valor definido:
<pre><font color="#ff9900">&lt;script&gt; </font>
<font color="#0000ff">function </font>valida(){
	<font color="#0000ff">if </font>(<font color="#ff6600">document</font>.form.email.value.<font color="#0000ff">indexOf</font>("@")==-1||<font color="#ff6600">document</font>.form.email.value.<font color="#0000ff">indexOf</font>(".")==-1){
	<font color="#ff6600">alert</font>('Digite um Email válido.');
	}<font color="#0000ff">else</font>{  <font color="#ff6600">document</font>.form.submit();  }
}
<font color="#ff9900">&lt;/script&gt;</font></pre>
</li>
<li>Salve a página e rode para testar.</li>
</ol>
<p>Quando for clicado em Enviar, será feita a verificação, caso tenha os caracteres específicos, então ele submete o formulário.</p>
<p>Abraços!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/quantodaniel.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/quantodaniel.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/quantodaniel.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/quantodaniel.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/quantodaniel.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/quantodaniel.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/quantodaniel.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/quantodaniel.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/quantodaniel.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/quantodaniel.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/quantodaniel.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/quantodaniel.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=quantodaniel.wordpress.com&blog=2059213&post=5&subd=quantodaniel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://quantodaniel.wordpress.com/2007/11/05/validar-email-com-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e1a13a71cc89521c4b6e83f914cbac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">quantodaniel</media:title>
		</media:content>
	</item>
	</channel>
</rss>