function validate() { if (!isset($this->value_list[$this->value]) && (!$this->value && $this->empty_value)) { $this->displayFieldError("Value " . $this->value . " is not one of offered values"); } return parent::validate(); }
function validate() { if (!isset($this->value_list[$this->value])) { /* if($this->api->isAjaxOutput()){ echo $this->ajax()->displayAlert($this->short_name.":"."This is not one of offered values")->execute(); } */ $this->displayFieldError("This is not one of offered values"); } return parent::validate(); }
function validate() { if (!$this->value) { return parent::validate(); } $this->getValueList(); //otherwise not preloaded? if (!isset($this->value_list[$this->value])) { /* if($this->api->isAjaxOutput()){ $this->ajax()->displayAlert($this->short_name.": This is not one of the offered values") ->execute(); } */ $this->form->errors[$this->short_name] = "This is not one of the offered values"; } return parent::validate(); }
function validate() { $list = $this->getValueList(); if (!$list || !$this->value) { return parent::validate(); } if (!isset($list[$this->value])) { if ($this->api->isAjaxOutput()) { /* $this->ajax()->displayAlert($this->short_name.": Please select to continue") ->execute(); */ $this->owner->displayError($this, 'Please select value from the list'); } $this->owner->errors[$this->short_name] = "Please value from the list"; } return parent::validate(); }