Changeset 129

Show
Ignore:
Timestamp:
05/28/08 16:11:30 (3 months ago)
Author:
felix
Message:

jquery mask on input fields (fix)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rapyd/components/fields/dataform_field.php

    r114 r129  
    3333  public $update_value = null; //default value for update 
    3434  public $options = array(); //associative&multidim. array ($value => $description) 
     35  public $mask = null; 
    3536 
    3637  public $value = null; 
  • trunk/rapyd/components/fields/input.php

    r108 r129  
    1717    parent::build(); 
    1818 
     19    //http://digitalbush.com/projects/masked-input-plugin 
     20    if (isset($this->mask)) 
     21    { 
     22      rpd_html::js('jquery/jquery.js'); 
     23      rpd_html::js('jquery/maskedinput.js'); 
     24    } 
     25 
    1926    switch ($this->status) 
    2027    { 
     
    3441      case "modify": 
    3542        $output = rpd_form::input($this->attributes, $this->value); 
     43        if (isset($this->mask)) 
     44        { 
     45          $output .= rpd_html::script(' 
     46                jQuery(function($){ 
     47                  $("#'.$this->name.'").mask("'.$this->mask.'"); 
     48                });'); 
     49        } 
    3650        break; 
    3751