Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/01/2011, 08:26
foxvor
 
Fecha de Ingreso: noviembre-2009
Mensajes: 40
Antigüedad: 14 años, 5 meses
Puntos: 2
Respuesta: textarea pierde el foco al escribir. Chrome

Va, que va sorry, ahi va:

Código PHP:
Ver original
  1. function textarea($nombre,$minimo,$maximo,$obligatorio,$filas,$cols,$extras)
  2.     {
  3.         $nombreCampo = $nombre . $this->nombre;
  4.         $campoBD = substr($nombre,0,-1);
  5.        
  6.         if($this->editar == true)
  7.         {
  8.             $regresar = '<textarea rows="' . $filas . '" cols="' . $cols . '" id="' . $nombreCampo . '" name="' . $nombreCampo . '" ' . $extras . '>' . ($this->item !=NULL ? $this->item[$campoBD] : (isset($_REQUEST[$nombreCampo]) ? $_REQUEST[$nombreCampo] : "")) . '</textarea>';
  9.             $regresar .= '<script type="text/javascript">
  10.                             var ' . $nombreCampo . ' = new LiveValidation("' . $nombreCampo . '",{ validMessage: "Ok"});
  11.                             ' . $nombreCampo . '.add( Validate.Length, { minimum:' . $minimo . ', maximum: ' . $maximo . '});';
  12.             if($obligatorio!=NULL && $obligatorio)
  13.             {
  14.                 $regresar .= $nombreCampo . '.add( Validate.Presence, { failureMessage: "Vacío" });';
  15.             }
  16.             $regresar .= '</script>';
  17.             return $regresar;
  18.         }
  19.         else
  20.         {
  21.             return ($this->item !=NULL ? $this->item[$campoBD] : 'No Definido');
  22.         }
  23.     }

tiene un montón de validaciones que no son de mayor importancia para este tema, pero ahi está la función