public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value) { } return $valid; }
public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value) { $valid = preg_match("/^[0-9]+\\-[0-1][0-9]\\-[0-3][0-9]\$/", $value); } return $valid; }
public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value) { $valid = preg_match("/^[0-9]{2}(:[0-9]{2}(:[0-9]{2})?)?\$/", $value); } return $valid; }
public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value) { $valid = $valid && preg_match("/^-?(?:\\d+|\\d*(\\.\\d+)?)\$/", $value); } return $valid; }
public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value && $this->multiple) { $valid = is_array($value); if ($valid) { if (is_array($this->options)) { foreach ($value as $item) { $valid = array_key_exists($item, $this->options); if (!$valid) { $this->form()->report_error($this->name, array('message' => 'out-of-options', 'value' => $item)); break; } } } else { $valid = false; } } } return $valid; }
public function is_valid() { $valid = parent::is_valid(); $value = $this->val(); if ($value) { if ($this->multiple) { if (is_array($this->options) && is_array($value)) { foreach ($value as $item) { foreach ($this->options as $opt) { if ($opt['value'] == $value) { $valid = true; break; } else { $valid = false; } } if (!$valid) { break; } } } else { $valid = false; } } else { foreach ($this->options as $opt) { if ($opt['value'] == $value) { $valid = true; break; } else { $valid = false; } } } } return $valid; }