Validates the form fields and submits their values if the validation was successful.<p>
767617
public void validateAndSubmit() {

        CmsValidationController validationController = new CmsValidationController(
            m_fields.values(),
            new I_CmsValidationHandler() {

                /**
                 * @see org.opencms.gwt.client.validation.I_CmsValidationHandler#onValidationFinished(boolean)
                 */
                public void onValidationFinished(boolean ok) {

                    m_formHandler.onSubmitValidationResult(CmsForm.this, ok);
                }

                /**
                 * @see org.opencms.gwt.client.validation.I_CmsValidationHandler#onValidationResult(java.lang.String, org.opencms.gwt.shared.CmsValidationResult)
                 */
                public void onValidationResult(String field, CmsValidationResult result) {

                    updateFieldValidationStatus(field, result);

                }

            });
        validationController.setFormValidator(m_validatorClass);
        validationController.setFormValidatorConfig(createValidatorConfig());
        startValidation(validationController);
    }
1262864
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (null != $this->validator && false != $this->validator) {
                if ('' === $this->user_value && false === $this->required) {
                    $this->is_valid = true;
                    return;
                } elseif ('' === $this->user_value && true === $this->required) {
                    $this->is_valid = false;
                    return;
                }
                try {
                    $validator = $this->validator;
                    $result = $validator::quickValidate($this->user_value, $this->constraints);
                    $this->user_value = $result;
                    $this->is_valid = true;
                } catch (InvalidInputException $e) {
                    $this->user_value = null;
                    $this->is_valid = false;
                    $this->error = $e->getMessage();
                }

            } else {
                // This field does not get validated
                $this->is_valid = true;
            }
        }
        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
641837
protected void validate() {

        CmsRpcAction<CmsAliasEditValidationReply> action = new CmsRpcAction<CmsAliasEditValidationReply>() {

            @Override
            public void execute() {

                CmsAliasEditValidationRequest validationRequest = new CmsAliasEditValidationRequest();

                List<CmsAliasTableRow> rows = m_view.getLiveData();
                validationRequest.setEditedData(rows);
                validationRequest.setOriginalData(m_initialData);
                getService().validateAliases(validationRequest, this);
            }

            @Override
            public void onResponse(CmsAliasEditValidationReply result) {

                stop(false);
                List<CmsAliasTableRow> changedRows = result.getChangedRows();
                m_view.update(changedRows);
                updateValidationStatus();
            }

        };
        action.execute();
    }
119741
public function validate()
    {
        $setToBreak = false;

        foreach ($this->_validations as $v) {
            foreach ($v['fields'] as $field) {
                if (isset($this->_skips[$field])) {
                    if ($this->_skips[$field] === self::SKIP_ALL) {
                        break 2;
                    }

                    if ($this->_skips[$field] === self::SKIP_ONE) {
                        break;
                    }
                }

                [$values, $multiple] = $this->getPart($this->_fields, \explode('.', $field));

                // Don't validate if the field is not required and the value is empty
                if (null !== $values && $this->hasRule('optional', $field)) {
                    //Continue with execution below if statement
                } elseif (
                    $v['rule'] !== 'accepted' &&
                    $v['rule'] !== 'required' && !$this->hasRule('required', $field) &&
                    (null === $values || $values === '' || ($multiple && \count($values) === 0))
                ) {
                    continue;
                }

                // Callback is user-specified or assumed method on class
                $errors = $this->getRules();
                if (isset($errors[$v['rule']])) {
                    $callback = $errors[$v['rule']];
                } else {
                    $callback = [$this, 'validate' . \ucfirst($v['rule'])];
                }

                if (!$multiple) {
                    $values = [$values];
                }

                $result = true;
                foreach ($values as $value) {
                    $result = $result && $callback($field, $value, $v['params'], $this->_fields);
                }

                if (!$result) {
                    $this->error($field, $v['message'], $v['params']);
                    if ($this->stopOnFirstFail) {
                        $setToBreak = true;
                        break;
                    }
                    $this->_skips[$field] = $v['skip'];
                }
            }

            if ($setToBreak) {
                break;
            }
        }

        return \count($this->errors()) === 0;
    }
1277855
protected function InitForm()
    {
        $this->submit = $this->LoadElement();
        
        $this->AddNameField();
        $this->AddValueField();
        
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
1371276
protected void validateRewrite() {

        CmsRpcAction<CmsRewriteAliasValidationReply> action = new CmsRpcAction<CmsRewriteAliasValidationReply>() {

            @Override
            public void execute() {

                start(200, true);
                List<CmsRewriteAliasTableRow> rowsToValidate = new ArrayList<CmsRewriteAliasTableRow>();
                rowsToValidate.addAll(m_view.getRewriteData());

                CmsRewriteAliasValidationRequest request = new CmsRewriteAliasValidationRequest(rowsToValidate);
                getService().validateRewriteAliases(request, this);
            }

            @Override
            public void onResponse(CmsRewriteAliasValidationReply result) {

                stop(false);
                m_view.update(result);
                updateValidationStatus();
            }

        };
        action.execute();
    }
186716
@Override
    void submit() {

        if ((m_user == null) || m_user.isManaged()) {
            return;
        }
        String password1 = m_form.getPassword1();
        String password2 = m_form.getPassword2();
        String error = null;
        if (validatePasswords(password1, password2)) {
            try {
                m_cms.setPassword(m_user.getName(), password1);
                CmsTokenValidator.clearToken(CmsLoginUI.m_adminCms, m_user);
            } catch (CmsException e) {
                error = e.getLocalizedMessage(m_locale);
                LOG.debug(e.getLocalizedMessage(), e);
            } catch (Exception e) {
                error = e.getLocalizedMessage();
                LOG.error(e.getLocalizedMessage(), e);
            }

            if (error != null) {
                m_form.setErrorPassword1(new UserError(error), OpenCmsTheme.SECURITY_INVALID);
            } else {
                CmsVaadinUtils.showAlert(
                    Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.GUI_PWCHANGE_SUCCESS_HEADER_0),
                    Messages.get().getBundle(A_CmsUI.get().getLocale()).key(
                        Messages.GUI_PWCHANGE_GUI_PWCHANGE_SUCCESS_CONTENT_0),
                    new Runnable() {

                        public void run() {

                            A_CmsUI.get().getPage().setLocation(
                                OpenCms.getLinkManager().substituteLinkForUnknownTarget(
                                    CmsLoginUI.m_adminCms,
                                    CmsWorkplaceLoginHandler.LOGIN_HANDLER,
                                    false));
                        }
                    });
            }
        }
    }
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 );
		}
311569
public function validateElements(){
		$this->_isValid = true;
		$values = $this->getParams();
		
		$this->recValidateElements($this->_elements, $values);
	}
928571
protected function validateRelationFields()
    {
        if (empty($this->submittedValues['sendCustomer']) && !empty($this->submittedValues['emailAsPdf'])) {
            $this->warningMessages['conflicting_options'] = $this->t('message_validate_conflicting_options');
        }
    }
1334254
function validateField(field, cb) {
        if (_.isArray(field.validation)) {
            async.each(field.validation, performValidation(field), function(err) {
                cb(err);
            });
        } else {
            cb();
        }
    }
547343
def validate(self, request, value):
        
        if self.required and value == DEFAULT_FIELD_VALUE:
            return ValidationResult(is_success=False,
                                    reason='This field is required')
        if not self.nullable and value is None:
            return ValidationResult(is_success=False,
                                    reason='null is not a valid value')
        return ValidationResult(is_success=True)
44644
private void validateInput() {
        // Check for null values first.
        if (url == null) {
            throw new NullPointerException("URL should not be null");
        }
        if (!url.getProtocol().matches("^https?$")) {
            throw new IllegalArgumentException(
                    "URL protocol should be HTTP or HTTPS");
        }
        if (url.getRef() != null) {
            throw new IllegalArgumentException(
                    "URL should contain no reference");
        }
        if (url.getQuery() != null) {
            throw new IllegalArgumentException(
                    "URL should contain no query string");
        }
        if (handler == null) {
            throw new NullPointerException(
                    "Callback handler should not be null");
        }
    }
312558
public void handleSubmit(I_CmsFormSubmitHandler handler) {

        Map<String, String> values = collectValues();
        Set<String> editedFields = new HashSet<String>(getEditedFields());
        editedFields.retainAll(values.keySet());
        handler.onSubmitForm(this, values, editedFields);
    }
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
93177
@SuppressWarnings("unchecked")
    private boolean isValid() {

        for (Field<?> field : m_fields) {
            if (!field.isValid()) {
                field.focus();

                return false;
            }
        }
        for (Component c : m_resources) {
            if (c instanceof CmsRemovableFormRow<?>) {
                if (!((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().isValid()) {
                    ((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().focus();
                    return false;
                }
            }
        }
        return true;
    }
930495
private void updateValidation() {

        boolean changed = false;
        changed |= CmsVaadinUtils.updateComponentError(m_textField, null);
        String path = getValue();
        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(path)) {
            if (!m_cms.existsResource(path, CmsResourceFilter.IGNORE_EXPIRATION)) {
                ErrorMessage error = new UserError(
                    CmsVaadinUtils.getMessageText(Messages.GUI_MODULES_MODULE_RESOURCE_NOT_FOUND_0),
                    ContentMode.TEXT,
                    ErrorLevel.WARNING);
                changed |= CmsVaadinUtils.updateComponentError(m_textField, error);
            }
        }
        if (changed) {
            fireEvent(new Component.ErrorEvent(null, this));
        }
    }