Revision: 725
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 2, 2006 10:53 by nicolaspar
Initial Code
errColor='#F7F7F7'; function trim(str){return str.replace(/^\\s*|\\s*$/g,'');} function completo(obj,nombre,tipo){if (tipo=='int'){ if ((trim(obj.value)=='')||(isNaN(obj.value))){obj.style.backgroundColor=errColor;return '\\n* '+nombre+' '}else{return '';};}else{ if (trim(obj.value)==''){obj.style.backgroundColor=errColor;return '\\n* '+nombre+'.'}else{return ''}}} 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}
Initial URL
Initial Description
Se incluye la funcion trim() agregada a completo y emailvalido.
Initial Title
Javascript - Validación básica
Initial Tags
Initial Language
PHP