33-10-Validacion-NivelCampo

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 3. over 4 years by phillipo
  2. 2. over 4 years by phillipo
  3. 1. over 4 years by phillipo
 

33.10 Validaciones (A nivel de Campo)

Tenemos la posibilidad de validar a nivel de campo, por ejemplo al salir de un campo, ejecute una funcion.

Ejemplo

  1. ?php
  2. $this->set_event(“nombre”, “blur”, 'alert("Sali de Nombre")');

Ejemplo: Al salir del campo nombre, nos pone el mismo valor en el campo razonsocial, como se ve el codigo javascript insertado en el onblur.

Ejemplo

  1. ?php
  2. class ClientesController extends StandardForm{
  3. public $scaffold = true;
  4. public $template = "menu";
  5.  
  6. function __construct(){
  7. $this- >set_event(“razonsocial”, “blur”, '$C(“razonsocial").value = $C(”nombre").value');
  8. }
  9.  
  10. function ClientesController(){
  11. $this->set_action_caption("insert","Agregar");
  12. $this->set_action_caption("report","Listado");
  13. $this->set_form_caption("Gestión de Clientes");
  14. $this->set_title_image("logo.jpg");
  15. $this->use_helper('codpostal');
  16. }
  17. }
  18. ?>



Regresar al indice