Ver Mensaje Individual
  #6 (permalink)  
Antiguo 18/06/2014, 10:50
adrian_
 
Fecha de Ingreso: abril-2010
Mensajes: 229
Antigüedad: 14 años, 10 meses
Puntos: 3
Respuesta: No funciona en chrome js

Hola

Gracias por responder les platico que es una aplicación que va formando todo con base en lo que le mandan pedir para formar un formulario se utilizan cosas como esta

Código PHP:
input('otro_telefono',$_SESSION['prospecto']['otro_telefono'],'txt',$mod,10,10,"","keybTelefono"); 
Este llama a un archivo que hace esto para construir lo que requiere el formulario
Código PHP:
function input($nombre,$valor,$tipo,$modo,$tam,$max,$datos,$onkeypress)
{
  global 
$fmt_fecha;
  global 
$fmt_fechahora;
   
$eventom NULL;

    if (
$onkeypress!='')
        {
        if (
$onkeypress=='keybNombre')
            {
            
$keypress="onblur='this.value=this.value.LimpiaCampo()'";
            }
        else
            {
            
$keypress="onkeypress='editKeyBoard(this,".$onkeypress.")'";
            }
        }
    else
        { 
        
$keypress='';
        }

  if (
$modo=='r'){
    switch (
$tipo){
      case 
'txt': echo $valor;break;
      case 
'int': echo $valor;break;
      case 
'num': echo $valor;break; 
      case 
'rad': echo $valor; break;
      case 
'psw': echo $valor; break;
      case 
'chk': echo $valor;break;
      case 
'tar': echo $valor;break;
      case 
'csm': echo $valor;break;
      case 
'cat': echo $valor;break;
      case 
'dat': if ($valor 0) { echo strftime($fmt_fecha,$valor); } else {echo "--/--/----";};break;
      case 
'dnt': if ($valor 0) { echo strftime($fmt_fecha,$valor); } else {echo "--/--/----";};break;
      case 
'sta': if ($valor 0) { echo strftime($fmt_fechahora,$valor); } else {echo "--/--/---- --:--";};break;
      case 
'dtm':  if ($valor 0) { echo strftime($fmt_fechahora,$valor); } else {echo "--/--/---- --:--";};break;
    }    
  } else {
    switch (
$tipo){
      case 
'txt': echo "<input type='text' id='".$nombre."' name='".$nombre."' value='".$valor."' 
                         size='"
.$tam."' maxlength='".$max."' ".$keypress." autocomplete=off >";break;
      case 
'int': echo "<input type='text'     name='".$nombre."' value='".$valor."' 
                         size='"
.$tam."' maxlength='".$max."' ".$keypress." >";break;
      case 
'num': echo "<input type='text'     name='".$nombre."' value='".$valor."'
                         size='"
.$tam."' maxlength='".$max."' ".$keypress." >";break;
      case 
'rad': echo "<input type='radio'    name='".$nombre."' value='".$valor."' size='".$tam."' maxlength='".$max."' >";break;
      case 
'psw': echo "<input type='password' name='".$nombre."' value='".$valor."' size='".$tam."' maxlength='".$max."' >";break;
      case 
'chk': echo "<input type='checkbox' name='".$nombre."' value='".$valor."' size='".$tam."'>";break;
      
      
      case 
'tar': echo "<textarea dataformatas='text' wrap='soft' 
                         name='"
.$nombre."' cols='".$tam."' rows='3'>".$valor."</textarea>";break;  
      case 
'ram':pon_radio_multiple($nombre,$datos,$valor,$onkeypress);break;
      
      case 
'rah':
      {
        
pon_radio_multiple_hr($nombre,$datos,$valor,$onkeypress);
        break;
      }
      case 
'dat':pon_fecha($nombre,$valor);break;
      case 
'sta':pon_fechayhora($nombre,$valor);break;
      case 
'cat':pon_catalogo($nombre,$datos,$valor,$onkeypress);break;    
      case 
'cte':combo_onchange($nombre,$datos,$valor,$accion); break;
      case 
'dnt':pon_fecha_nacimiento($nombre,$valor);break; 
      case 
'csm':pon_catalogo_multiple($nombre,$datos,$valor,$onkeypress);break;
      case 
'dtm':pon_fecha_mes($nombre,$valor);break;
      
      case 
'che':pon_chek_evento($nombre,$valor,$eventom,$onkeypress);
    }      
  }

y esta es mi funcion java

Código:
String.prototype.LimpiaCampo = function()
	{
	var tmp_this = this;
	var arr_busca = 	"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ".split("");
	var arr_reemplaza = "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn".split("");

	for(var i=0; i<arr_busca.length; i++)
		{
		tmp_this = tmp_this.replace(eval('/['+arr_busca[i]+']/g'), arr_reemplaza[i]);
		}
	tmp_this = tmp_this.replace(/[^a-zA-Z\\s ]/g,"");
	return tmp_this;
	}

var keybTelefono=new keybEdit('01234567890');

function keybEdit(strValid, strMsg)
	{
	//Variables
	var reWork = new RegExp('[a-z]','gi');
	//Properties
	if(reWork.test(strValid))
		{
			this.valid = strValid.toLowerCase() + strValid.toUpperCase();
		}
	else
		{
			this.valid = strValid;
		}
	
	if((strMsg == null) || (typeof(strMsg) == 'undefined'))
		{
	    	this.message = '';
		}
	else
		{
			this.message = strMsg;
		}
	//Methods
	this.getValid = keybEditGetValid;
	this.getMessage = keybEditGetMessage;
	
	function keybEditGetValid()
		{
			return this.valid.toString();
		}
	
	function keybEditGetMessage()
		{
			return this.message;
		}
	}
Agradezco cualquier ayuda.