Email address validation is rather difficult to get exactly right (in fact,
the only technically correct one that I know of uses the regex
here<http://ex-parrot.com/~pdw/Mail-RFC822-Address.html>,
and that's kind of absurd to implement). Your best bet is to google for
help. StackOverflow has a bunch of threads on the topic (try
this<http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address>,
this <http://stackoverflow.com/questions/36261/test-expand-my-email-regex>,
and
this<http://programmers.stackexchange.com/questions/78353/how-far-should-one-take-e-mail-address-validation>
to
start).
On Monday, December 24, 2012 9:09:45 PM UTC-5, Chrystopher Medina wrote:
>
>
> i did something like this and this works perfectly but now i really dont
> know how i can validate a email in the client side and server side
>
> <script>
> function soloLetras(e) {
> key = e.keyCode || e.which;
> tecla = String.fromCharCode(key).toLowerCase();
> letras = " áéíóúabcdefghijklmnñopqrstuvwxyz";
> especiales = [8, 37, 39, 46];
>
> tecla_especial = false
> for(var i in especiales) {
> if(key == especiales[i]) {
> tecla_especial = true;
> break;
> }
> }
>
> if(letras.indexOf(tecla) == -1 && !tecla_especial)
> return false;
> }
>
> function limpia() {
> var val = document.getElementById("miInput").value;
> var tam = val.length;
> for(i = 0; i < tam; i++) {
> if(!isNaN(val[i]))
> document.getElementById("miInput").value = '';
> }
> }
> </script>
>
> <input type="text" onkeypress="return soloLetras(event)" onblur="limpia()"
> id="miInput">
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/6yW__61BiAoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.