Submits data to the button.

@param string|null $submittedData The data
@param bool        $clearMissing  Not used

@return $this

@throws Exception\AlreadySubmittedException if the form has already been submitted
190160
public function submit($submittedData, $clearMissing = true)
    {
        if ($this->getConfig()->getDisabled()) {
            $this->clicked = false;

            return $this;
        }

        parent::submit($submittedData, $clearMissing);

        $this->clicked = null !== $submittedData;

        return $this;
    }
1093290
public function update_instance($formdata) {
        global $DB;
        $adminconfig = $this->get_admin_config();

        $update = new stdClass();
        $update->id = $formdata->instance;
        $update->name = $formdata->name;
        $update->timemodified = time();
        $update->course = $formdata->course;
        $update->intro = $formdata->intro;
        $update->introformat = $formdata->introformat;
        $update->alwaysshowdescription = !empty($formdata->alwaysshowdescription);
        $update->submissiondrafts = $formdata->submissiondrafts;
        $update->requiresubmissionstatement = $formdata->requiresubmissionstatement;
        $update->sendnotifications = $formdata->sendnotifications;
        $update->sendlatenotifications = $formdata->sendlatenotifications;
        $update->sendstudentnotifications = $adminconfig->sendstudentnotifications;
        if (isset($formdata->sendstudentnotifications)) {
            $update->sendstudentnotifications = $formdata->sendstudentnotifications;
        }
        $update->duedate = $formdata->duedate;
        $update->cutoffdate = $formdata->cutoffdate;
        $update->gradingduedate = $formdata->gradingduedate;
        $update->allowsubmissionsfromdate = $formdata->allowsubmissionsfromdate;
        $update->grade = $formdata->grade;
        if (!empty($formdata->completionunlocked)) {
            $update->completionsubmit = !empty($formdata->completionsubmit);
        }
        $update->teamsubmission = $formdata->teamsubmission;
        $update->requireallteammemberssubmit = $formdata->requireallteammemberssubmit;
        if (isset($formdata->teamsubmissiongroupingid)) {
            $update->teamsubmissiongroupingid = $formdata->teamsubmissiongroupingid;
        }
        if (isset($formdata->hidegrader)) {
            $update->hidegrader = $formdata->hidegrader;
        }
        $update->blindmarking = $formdata->blindmarking;
        $update->attemptreopenmethod = ASSIGN_ATTEMPT_REOPEN_METHOD_NONE;
        if (!empty($formdata->attemptreopenmethod)) {
            $update->attemptreopenmethod = $formdata->attemptreopenmethod;
        }
        if (!empty($formdata->maxattempts)) {
            $update->maxattempts = $formdata->maxattempts;
        }
        if (isset($formdata->preventsubmissionnotingroup)) {
            $update->preventsubmissionnotingroup = $formdata->preventsubmissionnotingroup;
        }
        $update->markingworkflow = $formdata->markingworkflow;
        $update->markingallocation = $formdata->markingallocation;
        if (empty($update->markingworkflow)) { // If marking workflow is disabled, make sure allocation is disabled.
            $update->markingallocation = 0;
        }

        $result = $DB->update_record('assign', $update);
        $this->instance = $DB->get_record('assign', array('id'=>$update->id), '*', MUST_EXIST);

        $this->save_intro_draft_files($formdata);

        // Load the assignment so the plugins have access to it.

        // Call save_settings hook for submission plugins.
        foreach ($this->submissionplugins as $plugin) {
            if (!$this->update_plugin_instance($plugin, $formdata)) {
                print_error($plugin->get_error());
                return false;
            }
        }
        foreach ($this->feedbackplugins as $plugin) {
            if (!$this->update_plugin_instance($plugin, $formdata)) {
                print_error($plugin->get_error());
                return false;
            }
        }

        $this->update_calendar($this->get_course_module()->id);
        $completionexpected = (!empty($formdata->completionexpected)) ? $formdata->completionexpected : null;
        \core_completion\api::update_completion_date_event($this->get_course_module()->id, 'assign', $this->instance,
                $completionexpected);
        $this->update_gradebook(false, $this->get_course_module()->id);

        $update = new stdClass();
        $update->id = $this->get_instance()->id;
        $update->nosubmissions = (!$this->is_any_submission_plugin_enabled()) ? 1: 0;
        $DB->update_record('assign', $update);

        return $result;
    }
337897
protected void submit() {

        if (m_userinfoNoEditGroup.getRows().size() != m_addInfoReadOnly.size()) {
            List<String> currentKeys = getKeyListFromGroup(m_userinfoNoEditGroup);
            for (String key : m_addInfoReadOnly.keySet()) {
                if (!currentKeys.contains(key)) {
                    saveAddInfo(key, null);
                }
            }
        }

        for (I_CmsEditableGroupRow row : m_userinfoGroup.getRows()) {
            String key = ((TextField)(((HorizontalLayout)row.getComponent()).getComponent(0))).getValue();
            String value = ((TextField)(((HorizontalLayout)row.getComponent()).getComponent(1))).getValue();
            saveAddInfo(key, value);
            m_addInfoEditable.remove(key);
        }

        //Remaining items in list seem to be deleted by the user..
        for (String key : m_addInfoEditable.keySet()) {
            saveAddInfo(key, null);
        }
        try {
            m_cms.writeUser(m_user);
        } catch (CmsException e) {
            LOG.error("Unable to write user.", e);
        }
    }
623550
public function submitBlock ($submitOptions = [], $cancelOptions = null)
		{
			$submitOptions = array_merge([
				'type'  => 'submit',
				'title' => Yii::tr('Save'),
				'name'  => 's-save',
				'class' => 'btn btn-primary'
			], $submitOptions);

			$submitButton = Html::submitButton($submitOptions[ 'title' ], $submitOptions);

			$cancelLink = '';
			if (is_array($cancelOptions))
			{
				$link = $cancelOptions[ 'referrer' ] ?? Yii::$app->request->referrer ?? Yii::$app->request->baseUrl;
				unset($cancelOptions[ 'referrer' ]);
				$cancelOptions = array_merge([
					'title' => Yii::tr('Cancel'),
					'class' => 'btn btn-warning ml-1'
				], $cancelOptions);
				$cancelLink = Html::a($cancelOptions[ 'title' ], $link, $cancelOptions);
			}

			/** @var \vps\tools\html\Field $field */
			$fieldConfig = array_merge([
				'form'        => $this,
				'model'       => new Model(),
				'attribute'   => 'submit',
				'enableLabel' => false
			], $this->fieldConfig);

			$field = new $this->fieldClass($fieldConfig);
			if ($this->layout === 'horizontal')
				Html::addCssClass($field->wrapperOptions, $fieldConfig[ 'horizontalCssClasses' ][ 'offset' ]);
			$field->parts[ '{input}' ] = $submitButton . $cancelLink;

			return $field->render();
		}
1371385
protected function validateData()
    {
        $field = 'data';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        if (!is_array($value)) {
            $this->setErrorInvalid($field, $this->translation->text('Data'));
            return false;
        }

        return true;
    }
443816
public function setForm(EntityForm $form)
    {
        if (!$form->isValid()) {
            throw new InvalidFormDataException(
                "Submitted form data is not valid."
            );
        }
        $this->setData($form->getData());
        $this->form = $form;
        return $this;
    }
1192678
protected function submitAddCity()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('city');
        $this->addCity();
    }
586369
@Override
    public void setSubmittedValue(final Object submittedValue) {
        if (submittedValue == null) {
            submittedValues.clear();
        }
        else {
            submittedValues = (Map<SheetRowColIndex, String>) submittedValue;
        }

    }
53721
public function submission($formData)
    {
        if ($form_settings = $this->_block->getContent(true)) {
            $form_settings = $this->_defaultData($form_settings);
            $form_rules = BlockFormRule::get_rules($form_settings->template ?: $this->_block->name);
            $v = Validator::make($formData, $form_rules);
            $captcha = Securimage::captchaCheck();

            // check form rules
            if ($v->passes() && !($form_settings->captcha && !$captcha)) {
                // delete blank and system fields
                unset($formData['captcha_code']);

                // Save data function (override this function to save data differently)
                $form_submission = $this->submissionSaveData($formData);
                if (!$form_submission->id) {
                    FormMessage::add('submission_save_error', 'Unable to save the form.');
                }

                // Send email
                if ($this->submissionSendEmail(unserialize($form_submission->content), $form_settings)) {
                    $form_submission->sent = 1;
                    $form_submission->save();
                }

                Session::put('form_data', $form_submission);
                return \redirect(PageBuilder::pageUrl($form_settings->page_to));
            } else {
                FormMessage::set($v->messages());
                if (!$captcha && $form_settings->captcha) {
                    FormMessage::add('captcha_code', 'Invalid Captcha Code, try again.');
                }
            }

        } else {
            return Response::make('No form settings found, try saving the form block in the admin.', 500);
        }

        return false;
    }
450911
public function onFakeSubmit(&$form, &$data) {
        if ($this->useMultiRowForm) {
            //Check if the insert button was pressed and act upon that
            if ($this->hasNew() && isset($data['insert_button']) && $data['insert_button']) {
                    // Add a row
                    $model          = $this->getModel();
                    $mname          = $model->getName();
                    $data[$mname][] = $model->loadNew();
            }
        }
    }
459803
public function postSetData(FormEvent $e)
    {
        if ($e->getData() === null) {
            return;
        }

        // Checks if the form has a given property
        // A property can be removed in a child class but the eventSubscriber still exists
        if (!$e->getForm()->has($this->property)) {
            return;
        }
        if ($this->provider->supports($e->getData())) {
            if ($item = $this->mm->getItemBy(array(':path' => $this->provider->url($e->getData())))) {
                $item->setAddToMenu(true);
                $e->getForm()->get($this->property)->setData($item);
            }
        }
    }
622919
public function submit($postContent)
    {
        // load current and submitted data
        $existingRepeaterRows = PageBlockRepeaterData::loadRepeaterData($postContent['repeater_id'], $this->_block->getVersionId());
        $submittedRepeaterRows = Request::input('repeater.' . $postContent['repeater_id']) ?: [];

        // save repeater id, if duplicating get new repeater id to save data to
        $postContent['repeater_id'] = static::$_duplicate ? PageBlockRepeaterRows::nextFreeRepeaterId() : $postContent['repeater_id'];
        $return = $this->save($postContent['repeater_id']);

        // if row missing, overwrite all data with blanks in new version
        if ($existingRepeaterRows && !static::$_duplicate) {
            foreach ($existingRepeaterRows as $rowId => $existingRepeaterRow) {
                if (empty($submittedRepeaterRows[$rowId])) {
                    foreach ($existingRepeaterRow as $blockId => $existingRepeaterBlockContent) {
                        $block = Block::preloadClone($blockId);
                        $block->id = $blockId;
                        if ($block->exists || $blockId === 0) {
                            $block->setVersionId($this->_block->getVersionId())->setRepeaterData($postContent['repeater_id'], $rowId)->setPageId($this->_block->getPageId())->getTypeObject()->save('');
                        }
                    }
                }
            }
        }

        // save new data
        $rowOrderNumber = 0;
        foreach ($submittedRepeaterRows as $rowId => $submittedRepeaterRow) {
            $rowOrderNumber++;
            foreach ($submittedRepeaterRow as $submittedBlockId => $submittedBlockData) {
                $block = Block::preloadClone($submittedBlockId)->setVersionId($this->_block->getVersionId())->setRepeaterData($postContent['repeater_id'], $rowId)->setPageId($this->_block->getPageId());
                if ($submittedBlockId == 0) { // use block id 0 to save order value
                    $block->exists = true;
                    $submittedBlockData = $rowOrderNumber;
                }
                if ($block->exists) {
                    $block->id = $submittedBlockId;
                    $block->getTypeObject()->submit($submittedBlockData);
                }
            }
        }

        return $return;
    }
1002871
public function fillObjectWithRawData($targetObject, $rawData)
	{
		$classDefinition = $this->classDefinitionBuilder->buildFromClass(get_class($targetObject));

		$this->processObject($classDefinition, $targetObject, $rawData);
	}
618710
public void submit() {
    try {

      Preconditions.checkArgument(Predicates.notNull().apply(eventSubmitter), "EventSubmitter needs to be set");
      Preconditions.checkArgument(NOT_NULL_OR_EMPTY_PREDICATE.apply(eventName), "Eventname is required");
      Preconditions.checkArgument(NOT_NULL_OR_EMPTY_PREDICATE.apply(datasetUrn), "DatasetUrn is required");

      eventSubmitter.submit(eventName, buildEventMap());

    } catch (IllegalArgumentException e) {
      log.info("Required arguments to submit an SLA event is not available. No Sla event will be submitted. " +  e.toString());
    }
  }
392950
public function setAdditionalData($additionalData) {
        if (is_null($additionalData)) {
            $additionalData = "";
        }
        if (!is_string($additionalData)) {
            throw new \Exception ("Additional Data must be a String");
        }
        $this->additionalData = $additionalData;
    }
1040482
protected function submitEditCity()
    {
        if ($this->isPosted('delete')) {
            $this->deleteCity();
        } else if ($this->isPosted('save') && $this->validateEditCity()) {
            if (isset($this->data_city['city_id'])) {
                $this->updateCity();
            } else {
                $this->addCity();
            }
        }
    }
528853
public function wasSubmitted()
    {
        $formMethod = strtoupper($this->getAttribute('method', 'post'));
        $formId = $this->getRequest()->getPost('form-id', false);
        $formId = $formId
            ? $formId
            : $this->getRequest()->getQuery('form-id', null);

        $submitted = $this->request->getMethod() == $formMethod &&
            $formId == $this->getId();
        if ($submitted) {
            $this->updateValuesFromRequest();
        }
        return $submitted;
    }