38 require_once realpath(dirname(__FILE__)).
"/../field_renderers.inc";
50 if ($field && !
$parent->data->hasField($field))
58 $label = isset($this->label) ? $this->label : $this->parent->prettifyFieldName($field);
71 $id =
"{$this->parent->id}_{$field}";
73 <script type=
'text/javascript'>
74 function <?echo $id?>_checkValid(input)
76 if (luhnCheck(input.value) && input.value.length > 12 && input.value.length < 20)
78 input.addClass(
'valid');
82 input.removeClass(
'valid');
95 $id =
"{$this->parent->id}_{$field}";
97 $onchange = (
$this->onChange) ?
"onchange='{$this->onChange}(this)'" :
"";
99 echo
"<input id='{$id}' type='text' class='credit_card_number' style='width: auto' name='$field'
100 value='".$this->parent->data->get($field).
"' autocomplete='off'
101 size='{$this->size}' onkeypress='return maskInput(event, 0);' $disable $onchange onkeyup='{$id}_checkValid(this)'/>";
110 echo $this->parent->data->get($field);
CreditCardNumberFieldRenderer(&$parent, $field=null)
renderField($field)
FieldRenderers must override this method to provide the HTML implementation of the control used to ed...
renderScript($field)
FieldRenderers can override this method to provide any Javascript that their control requires for an ...
addValidatorsToForm($field, $required=false)
This method is called by the AutoForm to add any default input validators that are required by the Fi...
FieldRenderer is the abstract base class for all FieldRenderers.
_startField($field, $styles="")
Internal method to generate the starting HTML for the field (including the label)
_endField($field)
Internal method to generate the closing HTML for the field.
FieldRenderer($parent)
Constructor.