Callback for submit-button which should return true if it could
carry out its work and false if something failed.

@return boolean true if okey, false if something went wrong.
491906
public function callbackSubmit()
    {
        // Get values from the submitted form
        $text = $this->form->value("text");

        if (!$this->di->get('session')->has("user")) {
            $this->form->addOutput("Du behöver logga in");
            return false;
        }

        $user = new User($this->di->get("db"));
        if ($user->controlAuthority($this->di->get('session')->get("user"), $this->post->user) != true) {
            $this->form->addOutput("Du får inte redigera denna.");
            return false;
        }

        if ($text == "") {
            $this->form->addOutput("Du skrev aldrig något. Skriv gärna något.");
            return false;
        }

        $this->post->text = $text;
        $this->post->save();
        $this->form->addOutput("Du har uppdaterat inlägget");
        return true;
    }
108451
protected function submit_buttons() {
        global $PAGE;
        if (has_capability('mod/quiz:deleteattempts', $this->context)) {
            echo '<input type="submit" class="btn btn-secondary mr-1" id="deleteattemptsbutton" name="delete" value="' .
                    get_string('deleteselected', 'quiz_overview') . '"/>';
            $PAGE->requires->event_handler('#deleteattemptsbutton', 'click', 'M.util.show_confirm_dialog',
                    array('message' => get_string('deleteattemptcheck', 'quiz')));
        }
    }
215792
protected function submitEditCheckout()
    {
        $this->setSubmitted('order');

        $this->setAddressFormCheckout();
        $this->submitAddAddressCheckout();

        if ($this->isPosted('checkout_login') && empty($this->uid)) {
            $this->show_login_form = true;
        }

        $this->same_payment_address = (bool) $this->getPosted('same_payment_address', true, false, 'bool');

        if ($this->isPosted('update')) {
            $this->setMessage($this->text('Form has been updated'), 'success', false);
        }

        $this->submitLoginCheckout();

        if ($this->isPosted('checkout_anonymous')) {
            $this->show_login_form = false;
        }

        $this->validateCouponCheckout();
        $this->submitCartCheckout();
        $this->submitOrderCheckout();
    }
725403
private function processSubmit()
    {
        $this->debug->group(__METHOD__);
        $this->debug->groupUncollapse();
        $cfg = &$this->cfg;
        $status = &$this->status;
        if ($status['submitted']) {
            $this->validate();
            if (\is_callable($cfg['post'])) {
                $return = \call_user_func($cfg['post'], $this);
                if ($return === false) {
                    $status['error'] = true;
                }
                // $this->updateInvalid();
            }
            if ($status['error']) {
                // $this->debug->log('status[error]', $status['error']);
                $this->alerts->add($cfg['messages']['errorAlert']);
            } elseif ($invalidFields = $this->getInvalidFields()) {
                // $this->debug->log('invalidFields', $invalidFields);
                $alert = $cfg['messages']['invalidAlert'];
                foreach ($invalidFields as $field) {
                    if (!\strlen($field->attribs['value'])) {
                        $alert = $cfg['messages']['unansweredAlert'];
                        break;
                    }
                }
                $this->alerts->add($alert);
            } else {
                $this->debug->info('completed ', $status['currentPageName']);
                $this->persist->set('currentPage.completed', true);
                $this->addRemovePages();
                if ($this->persist->pageCount(true) == $this->persist->pageCount()) {
                    $this->debug->info('completed all pages');
                    $status['completed'] = true;
                    $complete = new Complete($this);
                    $return = $complete->complete();
                    if ($return === false) {
                        $status['error'] = true;
                    } elseif (\is_string($return)) {
                        $cfg['messages']['completed'] = $return;
                    }
                    if ($status['error']) {
                        $this->alerts->add($this->cfg['messages']['errorAlert']);
                    } else {
                        $this->alerts->add($this->cfg['messages']['completedAlert']);
                    }
                    if ($this->status['completed'] && $cfg['trashOnComplete']) {
                        $this->debug->warn('shutting this whole thing down');
                        $this->persist->remove();
                    }
                } else {
                    $this->debug->info('more pages to go');
                    $nextI = $this->persist->get('nextI');
                    $this->setCurrentFields($nextI);
                }
            }
        }
        $this->debug->groupEnd();
    }
420945
public function isUploaded()
    {
        if ($this->form->isSubmitted() && is_array($this->value) && $this->value['error'] == UPLOAD_ERR_OK) {
            return true;
        }

        return false;
    }
907493
public function IsMyPostBack() {
      switch (strtolower($this->Method)) {
         case 'get':
            return count($_GET) > 0 || (is_array($this->FormValues()) && count($this->FormValues()) > 0) ? TRUE : FALSE;
         default:
            return Gdn::Request()->IsPostBack();
      }
   }
1103025
public function callbackSubmit()
    {
        $elements = ["accept_mail", "accept_phone", "accept_agreement"];
        foreach ($elements as $name) {
            $this->form->addOutput(
                "$name is "
                . ($this->form->value($name)
                    ? ""
                    : "not ")
                . "checked</br>"
            );
        }

        // Remember values during resubmit, for sake of the example
        $this->form->rememberValues();

        return true;
    }
804393
public function submitContentForm() {
    $element = $this->getSession()->getPage();
    $submit = $element->findButton($this->getDrupalText('node_submit_label'));
    if (empty($submit)) {
      throw new \Exception(sprintf("No submit button at %s", $this->getSession()->getCurrentUrl()));
    }
    // Submit the form.
    $submit->click();
  }
1173876
public function callbackSubmit()
    {
        // Get values from the submitted form
        $email       = $this->form->value("email");

        if (strpos($email, '%') !== false) {
            $this->form->addOutput("% is not allowed");
            return false;
        }


        if (!$this->di->get('session')->get("user")) {
            return false;
        }
        $name = $this->di->get('session')->get("user");
          $user = new User();
          $user->setDb($this->di->get("db"));
          $user->find("name", $name);

          $user->email = $email;
          $user->save();
          return true;
    }
913196
protected function requireSubmitValue()
    {
        if ($this->system->input()->post('submit')) {
            echo 'LOOK: ' . $this->system->input()->post('submit') . PHP_EOL;
            return;
        }

        $this->setNotReady("No submit value present.");
    }
504807
def handle_submit(self):
        
        wst_uid = self.request.form.get("getWorksheetTemplate")
        if not wst_uid:
            return False

        layout = self.context.getLayout()
        wst = api.get_object_by_uid(wst_uid)

        self.request["context_uid"] = api.get_uid(self.context)
        self.context.applyWorksheetTemplate(wst)

        if len(self.context.getLayout()) == len(layout):
            return False
        return True
1021585
protected function processForm()
    {
        // Check job monitors as long as the login form is being processed
        $this->util->getMonitor()->checkMonitors();

        // Start the real work
        $this->loadForm();

        $orgId = null;
        if ($this->request->isPost()) {
            $orgId = $this->loginForm->getActiveOrganizationId();

            if ($orgId && ($this->currentUser->getCurrentOrganizationId() != $orgId)) {
                $this->currentUser->setCurrentOrganization($orgId);
            }
        }

        if ($this->loginForm->wasSubmitted()) {
            $user = $this->loginForm->getUser();

            if ($this->loginForm->isValid($this->request->getPost(), false)) {
                $user->switchLocale();

                $this->loginStatusTracker
                        ->setPasswordText($this->loginForm->getPasswordText())
                        ->setUser($user);

                return false;
            }

            $errors = \MUtil_Ra::flatten($this->loginForm->getMessages());
            // \MUtil_Echo::track($errors);

            // Also log the error to the log table  when the project has logging enabled
            $logErrors = join(' - ', $errors);
            $msg = sprintf(
                    'Failed login for : %s (%s) - %s',
                    $user->getLoginName(),
                    $user->getCurrentOrganizationId(),
                    $logErrors
                    );
            $this->accesslog->logChange($this->request, $msg);
        }

        return true;
    }
241923
def submit_button(*args, **kwargs):
    '''
    
    '''
    submit_button = wtforms.SubmitField(*args, **kwargs)
    submit_button.input_type = 'submit_button'
    return submit_button
1011192
public function callbackSubmit()
    {
        // Get values from the submitted form
        $name       = $this->form->value("user");
        $password      = $this->form->value("password");

        $user = new User();
        $user->setDb($this->di->get("db"));
        $res = $user->verifyPassword($name, $password);

        if (!$res) {
            $this->form->rememberValues();
            $this->form->addOutput("User or password did not match.");
            return false;
        }

        $this->di->get('session')->set("user", $name); # set user in session
        $this->di->get("response")->redirect("user/profile");
    }
808621
public function isValidCallback(): bool
    {
        if (!$this->isValidHubSignature()) {
            return false;
        }

        $decodedBody = $this->getDecodedBody();

        $object = $decodedBody['object'] ?? null;
        $entry = $decodedBody['entry'] ?? null;

        return $object === 'page' && $entry !== null;
    }
806001
protected function isValid()
    {
        if (!$this->request->ajax()) {
            return false;
        }
        $search = $this->request->input('search');
        if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
            return false;
        }
        $token = $this->request->header('search-protection');
        if (!$this->validateToken($token)) {
            return false;
        }
        return true;
    }
1129947
public function isValidCallbackRequest()
    {
        if (!$this->isValidHubSignature()) {
            return false;
        }

        $decoded = $this->getDecodedBody();

        $object = isset($decoded['object']) ? $decoded['object'] : null;
        $entry = isset($decoded['entry']) ? $decoded['entry'] : null;

        return $object === 'page' && null !== $entry;
    }