If the field is not visible on the form view, clear the validation.

@return $this
514572
protected function optimizeValidations()
    {
        if (!$this->field->isNullable && !in_array('required', $this->field->validationRules)) {
            array_unshift($this->field->validationRules, 'required');
        }

        if (($rule = $this->field->getDateValidationRule()) != null && !in_array($rule, $this->field->validationRules)) {
            $this->field->validationRules[] = $rule;
        }

        if (!$this->field->isOnFormView) {
            // At this point we know the field is not going to be on any request form
            // remove all validation rules if any exists.
            $this->field->validationRules = [];
        }

        if ($this->field->isCheckBox() && $this->field->isBoolean()) {
            // At this point we know the field is a checkbox and is a boolean type
            // remove the required validation rule.
            $this->field->validationRules = array_filter($this->field->validationRules, function ($rule) {
                return $rule != 'required';
            });
        }

        return $this;
    }
1235988
public function reset()
    {
        $this->html        = array(array());
        $this->hiddenHtml  = '';
        $this->errors      = array();
        $this->hasRequired = false;
        $this->groupId     = array();

        return $this;
    }
45710
public function clearTable()
    {
        $properties = $this->getProperties();
        $properties['cols'] = [];
        $properties['datas'] = [];
        $properties['styles'] = [];
        $properties['events'] = [];
        $this->setProperties($properties);
        return $this;
    }
1346968
public function beforeValidate()
    {
        $this->reset();
        foreach ($this->relations as $key => $relation) {
            $data = is_array($relation) ? $relation : [];
            $relation = is_array($relation) ? $key : $relation;
            $ruleLoad = FormHelper::loadRelation($this->owner, $relation, Yii::$app->request->post(), $data);
            $this->savingModels[$relation] = $ruleLoad['models'];
            foreach ($ruleLoad['errors'] as $errors) {
                $this->owner->addError($relation, json_encode($errors, JSON_UNESCAPED_UNICODE));
            }
        }
    }
1228166
public function clear()
    {
        $this->mailer = null;
        $this->to = $this->attachemnts = array();
        $this->subject = $this->message = false;
        return $this;
    }
1271088
public function validate()
    {
        foreach ($this as $element) {

            if (
                $element instanceof ValidationAwareInterface ||
                $element instanceof ContainerInterface
            ) {
                $element->validate();
            }
        }
        return $this;
    }
1308274
public function checkRequired()
    {
        foreach ($this->required as $attribute) {
            throw_if(! collect($this->attributes)->offsetExists($attribute),
                FieldRequiredAttributeException::class, $attribute);
        }

        return $this;
    }
1317910
public function addRule()
    {
        foreach ($this->rules as $field => $rule) {
            $this->validation->addRule($field, $rule);
        }

        return $this;
    }
621862
protected function removeReservedFields()
    {
        if (!$this->isMode(static::MODE_CREATE)) {
            return;
        }

        $reservedColumns = [
            $this->form->model()->getKeyName(),
            $this->form->model()->getCreatedAtColumn(),
            $this->form->model()->getUpdatedAtColumn(),
        ];

        $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) {
            return in_array($field->column(), $reservedColumns, true);
        });
    }
630135
public void clear() {
        queryTextField.clear();
        validationIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
        validationIcon.setStyleName("hide-status-label");
    }
87119
public function clearEmptySteps()
    {
        foreach ($this as $field) {
            if ($field instanceof UserFormsStepField && count($field->getChildren()) === 0) {
                $this->remove($field);
            }
        }
    }
712777
public function validateRequired()
    {
        $this->validator_attributes[] = 'data-parsley-required';

        $this->field_required = true;

        $this->validator_checks['required'] = true;

        return $this;
    }
790506
public function clear()
    {
        $this->currentOutput = '';
        $this->accruedInput = '';
        $this->accruedInputWithoutFormatting = '';
        $this->formattingTemplate = '';
        $this->lastMatchPosition = 0;
        $this->currentFormattingPattern = '';
        $this->prefixBeforeNationalNumber = '';
        $this->extractedNationalPrefix = '';
        $this->nationalNumber = '';
        $this->ableToFormat = true;
        $this->inputHasFormatting = false;
        $this->positionToRemember = 0;
        $this->originalPosition = 0;
        $this->isCompleteNumber = false;
        $this->isExpectingCountryCallingCode = false;
        $this->possibleFormats = array();
        $this->shouldAddSpaceAfterNationalPrefix = false;
        if ($this->currentMetadata !== $this->defaultMetadata) {
            $this->currentMetadata = $this->getMetadataForRegion($this->defaultCountry);
        }
    }
584079
public function & RemoveField ($fieldOrFieldName = NULL) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		if ($this->dispatchState < 1) $this->Init();
		$fieldName = NULL;
		if ($fieldOrFieldName instanceof \MvcCore\Ext\Forms\IField) {
			$fieldName = $fieldOrFieldName->GetName();
		} else if (is_string($fieldOrFieldName)) {
			$fieldName = $fieldOrFieldName;
		}
		if (isset($this->fields[$fieldName]))
			unset($this->fields[$fieldName]);
		return $this;
	}
1139830
function() {
			/// <summary>
			/// Resets the controlled form.
			/// Resets input fields to their original value (requires form plugin), removes classes
			/// indicating invalid elements and hides error messages.
			/// </summary>

			if ( $.fn.resetForm )
				$( this.currentForm ).resetForm();
			this.submitted = {};
			this.prepareForm();
			this.hideErrors();
			this.elements().removeClass( this.settings.errorClass );
		}
96220
public function removeAllValidation()
    {
        if ($this->form) {
            foreach ($this->constraints as $fieldName => $constraints) {
                foreach ($constraints as $constraint) {
                    $constraint->removeParsley();
                    unset($constraint);
                }
            }
        }
        $this->constraints = array();
    }
37237
public function clear () {
        $this->_data = null;
        $this->_count = null;
        $this->getConnection ()->getClient ()->delete ($this->name);
        return $this;
    }