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.
161406
public function callbackSubmit()
    {
        // Get values from the submitted form
        $name       = $this->form->value("name");
        $email       = $this->form->value("email");
        $password      = $this->form->value("password");
        $passwordAgain = $this->form->value("password-again");

        // Check password matches
        if ($password !== $passwordAgain) {
            $this->form->rememberValues();
            $this->form->addOutput("Password did not match.");
            return false;
        }

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

         $user = new User();
         $user->setDb($this->di->get("db"));

        if ($user->userExists($name)) {
             $this->form->addOutput("User already exists");
             return false;
        }

          $user->name = $name;
          $user->email = $email;
          $user->authority = $this->form->value("select");
          $user->setPassword($password);
          $user->save();

          $this->form->addOutput("You added the user");
          return true;
    }
565984
function() {
			/// <summary>
			/// Validates the form, returns true if it is valid, false otherwise.
			/// This behaves as a normal submit event, but returns the result.
			/// </summary>
			/// <returns type="Boolean" />

			this.checkForm();
			$.extend(this.submitted, this.errorMap);
			this.invalid = $.extend({}, this.errorMap);
			if (!this.valid())
				$(this.currentForm).triggerHandler("invalid-form", [this]);
			this.showErrors();
			return this.valid();
		}
444491
public function callbackSubmit()
    {

        $email       = $this->form->value("email");
        $password    = $this->form->value("password");

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

        if (!$res) {
            $this->form->rememberValues();
            $this->form->addOutput("Användarnamnet eller lösenordet stämmer inte överens.", "flash");

            return false;
        }

        if (!$user->isActive($email)) {
            $this->form->addOutput("Kontot är inte aktiverat.", "flash");
            return false;
        }

        $this->di->get("session")->set("user", $user->email);
        $this->di->get("session")->set("userid", $user->id);


        $this->di->get("response")->redirect("user");
        return true;
    }
473853
public function isSaveable()
    {
        return !$this->showOnClick
            || ($this->showOnClick && $this->hiddenField && $this->hiddenField->Value());
    }
1199100
public function callbackSubmit()
    {
        $comm = new Comm();
        $comm->setDb($this->di->get("db"));
        $one = $this->form->value("select");

        $all = $comm->findAll();
        $objects = "";

        foreach ($all as $obj) {
            if ($obj->parentid && $obj->parentid == $one) {
                echo 'Ja: ' . $obj->parentid . ' kastar ' . $obj->id . '<br />';
                $comm->find("id", $obj->id);
                $objects .= $comm->title . ", ";
                $comm->delete();
            }
        }

        $comm->find("id", $this->form->value("select"));
        $titles = $objects . $comm->title;
        $comm->delete();
        $this->form->addOutput($titles . ": kastad.");

        $pagerender = $this->di->get("pageRender");
        $pagerender->redirect("comm");
    }
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
53917
public function isValid()
	{
	  	// Skip without submission
		if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST') {

			return FALSE;

		} else {

			$captchaChallenge = isset($_POST['recaptcha_challenge_field'])
				? $this->_sanitizeField($_POST['recaptcha_challenge_field'])
				: NULL;

			$captchaResponse  = isset($_POST['recaptcha_response_field'])
				? $this->_sanitizeField($_POST['recaptcha_response_field'])
				: NULL;
		 	// Skip empty submission
			if ( strlen($captchaChallenge) == 0 || strlen($captchaResponse) == 0 ) {
				$this->setError('incorrect-captcha-sol');
				return FALSE;
			}

			$data = array(
				'privatekey' => $this->_privateKey,
				'remoteip'   => $this->_remoteIp(),
				'challenge'  => $captchaChallenge,
				'response'   => $captchaResponse
				);

			$result = $this->_postHttpChallenge($data);

			if ( $result['isvalid'] === "true") {
				return TRUE;

			} else {
				$this->setError($result['error']);
			}
			return FALSE;
		}
	}
772627
public function handleCallbackStatus() {
    // Read the body of the request
    $body = @file_get_contents('php://input');

    if ($body != null && strlen(trim($body)) > 0) {
      $status = json_decode(trim($body), false);

      if ($status != null && is_object($status)) {
        $this->initStatus($status);

        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();
      }
   }
442555
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;
        }

          $user = $this->user;

          $user->email = $email;
          $user->authority = $this->form->value("select") ?: "user";
          $user->save();
          $this->form->addOutput("Du uppdaterade användaren");
          return true;
    }
1094212
function validate()
    {
        if (count($this->_rules) == 0 && count($this->_formRules) == 0 &&
            $this->isSubmitted()) {
            return (0 == count($this->_errors));
        } elseif (!$this->isSubmitted()) {
            return false;
        }

        include_once('HTML/QuickForm/RuleRegistry.php');
        $registry =& HTML_QuickForm_RuleRegistry::singleton();

        foreach ($this->_rules as $target => $rules) {
            $submitValue = $this->getSubmitValue($target);

            foreach ($rules as $rule) {
                if ((isset($rule['group']) && isset($this->_errors[$rule['group']])) ||
                     isset($this->_errors[$target])) {
                    continue 2;
                }
                // If element is not required and is empty, we shouldn't validate it
                if (!$this->isElementRequired($target)) {
                    if (!isset($submitValue) || '' == $submitValue) {
                        continue 2;
                    // Fix for bug #3501: we shouldn't validate not uploaded files, either.
                    // Unfortunately, we can't just use $element->isUploadedFile() since
                    // the element in question can be buried in group. Thus this hack.
                    } elseif (is_array($submitValue)) {
                        if (false === ($pos = strpos($target, '['))) {
                            $isUpload = !empty($this->_submitFiles[$target]);
                        } else {
                            $base = substr($target, 0, $pos);
                            $idx  = "['" . str_replace(array(']', '['), array('', "']['"), substr($target, $pos + 1, -1)) . "']";
                            eval("\$isUpload = isset(\$this->_submitFiles['{$base}']['name']{$idx});");
                        }
                        if ($isUpload && (!isset($submitValue['error']) || 0 != $submitValue['error'])) {
                            continue 2;
                        }
                    }
                }
                if (isset($rule['dependent']) && is_array($rule['dependent'])) {
                    $values = array($submitValue);
                    foreach ($rule['dependent'] as $elName) {
                        $values[] = $this->getSubmitValue($elName);
                    }
                    $result = $registry->validate($rule['type'], $values, $rule['format'], true);
                } elseif (is_array($submitValue) && !isset($rule['howmany'])) {
                    $result = $registry->validate($rule['type'], $submitValue, $rule['format'], true);
                } else {
                    $result = $registry->validate($rule['type'], $submitValue, $rule['format'], false);
                }

                if (!$result || (!empty($rule['howmany']) && $rule['howmany'] > (int)$result)) {
                    if (isset($rule['group'])) {
                        $this->_errors[$rule['group']] = $rule['message'];
                    } else {
                        $this->_errors[$target] = $rule['message'];
                    }
                }
            }
        }

        // process the global rules now
        foreach ($this->_formRules as $rule) {
            if (true !== ($res = call_user_func($rule, $this->_submitValues, $this->_submitFiles))) {
                if (is_array($res)) {
                    $this->_errors += $res;
                } else {
                    return self::raiseError(null, QUICKFORM_ERROR, null, E_USER_WARNING, 'Form rule callback returned invalid value in HTML_QuickForm::validate()', 'HTML_QuickForm_Error', true);
                }
            }
        }

        return (0 == count($this->_errors));
    }
387709
protected function submit_button(question_attempt $qa, question_display_options $options) {
        if (!$qa->get_state()->is_active()) {
            return '';
        }
        $attributes = array(
            'type' => 'submit',
            'id' => $qa->get_behaviour_field_name('submit'),
            'name' => $qa->get_behaviour_field_name('submit'),
            'value' => get_string('check', 'question'),
            'class' => 'submit btn btn-secondary',
        );
        if ($options->readonly) {
            $attributes['disabled'] = 'disabled';
        }
        $output = html_writer::empty_tag('input', $attributes);
        if (!$options->readonly) {
            $this->page->requires->js_init_call('M.core_question_engine.init_submit_button',
                    array($attributes['id'], $qa->get_slot()));
        }
        return $output;
    }
582190
public function canSubmit() {

		return 
			$this instanceof InputElement && isset($this->attributes['type']) && $this->attributes['type'] == 'submit' ||
			$this instanceof ImageElement ||
			$this instanceof SubmitInputElement ||
			$this instanceof ButtonElement && $this->attributes['type'] == 'submit';

	}
1035649
public function formSubmitSuccess()
    {
        return $this->form->js(null, $this->js()->trigger('reload'))
            ->univ()->closeDialog();
    }
903657
public function isSubmitted($blnForce = false)
    {
        $blnReturn = false;

        if (ValidForm::get("vf__dispatch") == $this->__name) {
            // *** Try to retrieve the uniqueId from a REQUEST value.
            $strUniqueId = ValidWizard::get("vf__uniqueid");
            if (! empty($strUniqueId)) {
                $this->__setUniqueId($strUniqueId);
            }

            $blnReturn = true;
        } elseif ($blnForce) {
            $blnReturn = true;
        }

        return $blnReturn;
    }
1068941
private function submit ()
    {
        foreach ($this->getFields() as $field)
            /* @var $field Field */
            $field->submit();
        $this->isCallbacksubmitted = true;
        foreach ($this->callback as $callback)
            if (is_callable($callback))
                call_user_func($callback, $this);
    }
39596
public function callbackSubmit($form)
    {
        $form->AddOutput("<p>DoSubmit(): Form was submitted.<p>");
        $form->AddOutput("<p>Do stuff (save to database) and return true (success) or false (failed processing)</p>");
        $form->AddOutput("<p><b>Name: " . $form->Value('name') . "</b></p>");
        $form->AddOutput("<p><b>Email: " . $form->Value('email') . "</b></p>");
        $form->AddOutput("<p><b>Phone: " . $form->Value('phone') . "</b></p>");
        $form->saveInSession = true;
        return true;
    }