예제 #1
0
파일: Radio.php 프로젝트: TigerBui/atk4
 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();
 }
예제 #2
0
 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();
 }
예제 #3
0
 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();
 }
예제 #4
0
 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();
 }