/ Published in: PHP
Se incluye la funcion trim() agregada a completo y emailvalido.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
errColor='#F7F7F7'; function emailvalido(obj,nombre) {msg = '';if(obj.value!=''){var reg1 = /(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)/;var reg2 = /^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$/;if (reg1.test(obj.value) || !reg2.test(obj.value)){obj.style.backgroundColor=errColor;msg= '\\n* '+nombre+'.'}}else{obj.style.backgroundColor=errColor; msg='\\n* '+nombre+'.'} return msg}