Prado\Web\UI\WebControls\TBaseValidator::getClientScriptOptions PHP Method

getClientScriptOptions() protected method

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
return array javascript validator options.
    protected function getClientScriptOptions()
    {
        $control = $this->getValidationTarget();
        $options['ID'] = $this->getClientID();
        $options['FormID'] = $this->getPage()->getForm()->getClientID();
        $options['Display'] = $this->getDisplay();
        $options['ErrorMessage'] = $this->getErrorMessage();
        if ($this->getFocusOnError()) {
            $options['FocusOnError'] = $this->getFocusOnError();
            $options['FocusElementID'] = $this->getFocusElementID();
        }
        $options['ValidationGroup'] = $this->getValidationGroup();
        if ($control) {
            $options['ControlToValidate'] = $control->getClientID();
        }
        $options['ControlCssClass'] = $this->getControlCssClass();
        $options['ControlType'] = $this->getClientControlClass($control);
        $options['Enabled'] = $this->getEnabled(true);
        //get date format from date picker target control
        if ($control instanceof TDatePicker) {
            $options['DateFormat'] = $control->getDateFormat();
        }
        $options = array_merge($options, $this->getClientSide()->getOptions()->toArray());
        return $options;
    }

Usage Example

 /**
  * Returns an array of javascript validator options.
  * @return array javascript validator options.
  */
 protected function getClientScriptOptions()
 {
     $options = TBaseValidator::getClientScriptOptions();
     $options['EventTarget'] = $this->getUniqueID();
     return $options;
 }
All Usage Examples Of Prado\Web\UI\WebControls\TBaseValidator::getClientScriptOptions