Same as submit button, only with btn-primary class added
167239
def primary(value = nil, options = {}, &block)
      add_css_class!(options, "btn-primary")
      submit(value, options, &block)
    end
164801
protected void initComponent()
	{
		addOrReplace(form = newForm("form", getModel()));
		form.addOrReplace(signupPanel = newSignupPanel("signupPanel", getModel()));

		form.addOrReplace(submitButton = newButton("signupButton"));
		submitButton.add(
			buttonLabel = newButtonLabel("buttonLabel", "global.button.sign.up.label", "Sign up"));
		form.add(submitButton);

		form.add(new EqualPasswordInputValidator(
			signupPanel.getSigninPanel().getPassword().getPasswordTextField(),
			signupPanel.getRepeatPassword().getPasswordTextField()));
	}
598780
public function init() {
		
		if (false === $this->visible) {
			return;
		}

		$classes = array('btn');

		if ($this->isValidContext()) {
			$classes[] = 'btn-' . $this->getContextClass();
		}
		
		if($this->buttonType == self::BUTTON_LINK) {
			$classes[] = 'btn-link';
		}

		$validSizes = array(
			self::SIZE_LARGE, 
			self::SIZE_DEFAULT,
			self::SIZE_SMALL, 
			self::SIZE_EXTRA_SMALL
		);

		if (isset($this->size) && in_array($this->size, $validSizes)) {
			$classes[] = self::$sizeClasses[$this->size];
		}

		if ($this->block) {
			$classes[] = 'btn-block';
		}

		if ($this->active) {
			$classes[] = 'active';
		}

		if ($this->disabled) {
			$disableTypes = array(
				self::BUTTON_BUTTON,
				self::BUTTON_SUBMIT,
				self::BUTTON_RESET,
				self::BUTTON_AJAXBUTTON,
				self::BUTTON_AJAXSUBMIT,
				self::BUTTON_INPUTBUTTON,
				self::BUTTON_INPUTSUBMIT
			);

			if (in_array($this->buttonType, $disableTypes)) {
				$this->htmlOptions['disabled'] = 'disabled';
			}

			$classes[] = 'disabled';
		}

		if (!isset($this->url) && isset($this->htmlOptions['href'])) {
			$this->url = $this->htmlOptions['href'];
			unset($this->htmlOptions['href']);
		}

		if ($this->encodeLabel) {
			$this->label = CHtml::encode($this->label);
		}

		if ($this->hasDropdown()) {
			if (!isset($this->url)) {
				$this->url = '#';
			}

			$classes[] = 'dropdown-toggle';
			$this->label .= ' <span class="caret"></span>';
			$this->htmlOptions['data-toggle'] = 'dropdown';
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}

		if (isset($this->icon)) { // no need for implode as newglyphicon only supports one icon
			if (strpos($this->icon, 'icon') === false && strpos($this->icon, 'fa') === false) {
				$this->icon = 'glyphicon glyphicon-' . $this->icon;
				$this->label = '<span class="' . $this->icon . '"></span> ' . $this->label;
			} else { // to support font awesome icons
				$this->label = '<i class="' . $this->icon . '"></i> ' . $this->label;
			}
		}

		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		if (isset($this->toggle)) {
			$this->htmlOptions['data-toggle'] = 'button';
		}

		if (isset($this->loadingText)) {
			$this->htmlOptions['data-loading-text'] = $this->loadingText;
		}

		if (isset($this->completeText)) {
			$this->htmlOptions['data-complete-text'] = $this->completeText;
		}

        if (!empty($this->tooltip) && !$this->toggle) {
            if (!is_array($this->tooltipOptions)) {
                $this->tooltipOptions = array();
            }

            $this->htmlOptions['data-toggle'] = 'tooltip';
            foreach ($this->tooltipOptions as $key => $value) {
                $this->htmlOptions['data-' . $key] = $value;
            }

            /**
             * Encode delay option
             * @link http://getbootstrap.com/2.3.2/javascript.html#tooltips
             */
            if (isset($this->htmlOptions['data-delay']) && is_array($this->htmlOptions['data-delay'])) {
                $this->htmlOptions['data-delay'] = CJSON::encode($this->htmlOptions['data-delay']);
            }
        }
	}
388763
public function formButton($url, $method, $name, $position="BL", $attributes=array())
    {
        $attributes = array_merge(array("class"=>"btn btn-default"), $attributes);
        $this->button_container[$position][] = Form::open(array('url' => $url, 'method' => $method)).Form::submit($name, $attributes).Form::close();

        return $this;
    }
357797
function buttonPostback(payload, callback)
{
  if (typeof payload.payload != 'string')
  {
    payload.payload = JSON.stringify(payload.payload);
  }

  callback(null, payload);
}
104602
function(form, e, eventData) {

    e.preventDefault();

    var formElement = $(form);

    if(formElement.hasClass('success')) {
      getAvailability();
      hideBookingPage();
      return;
    }

    // Abort if form is submitting, have submitted or does not validate
    if(formElement.hasClass('loading') || formElement.hasClass('error') || !e.target.checkValidity()) {
      var submitButton = formElement.find('.bookingjs-form-button');
      submitButton.addClass('button-shake');
      setTimeout(function() {
        submitButton.removeClass('button-shake');
      }, 500);
      return;
    }

    var formData = {};
    $.each(formElement.serializeArray(), function(i, field) {
      formData[field.name] = field.value;
    });

    formElement.addClass('loading');

    utils.doCallback('submitBookingForm', formData);

    // Call create event endpoint
    timekitCreateBooking(formData, eventData).then(function(response){

      formElement.find('.booked-email').html(formData.email);
      formElement.removeClass('loading').addClass('success');

    }).catch(function(response){

      showBookingFailed(formElement)

    });

  }
33030
function() {
			if (this.$buttonContainer && Array.isArray(this.buttons)) {
				var self = this;
				this.buttons.forEach(function(buttonDefinition) {
					var button = uiUtil.createButton(buttonDefinition.text, buttonDefinition.callback);
					if (buttonDefinition.id) {
						button.id = buttonDefinition.id;
						self['$'+ button.id] = button; //$NON-NLS-0$					
					}
					if (buttonDefinition.isDefault) {
						self._defaultCallback = buttonDefinition.callback;
						self._defaultButton = button;
						button.classList.add("primaryButton"); //$NON-NLS-0$
					}
					self.$buttonContainer.appendChild(button);
				});
			}
		}
229894
public function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null, $primary = null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($elementName, $value, $attributes, $primary);
    }
1248018
function (fn) {
				var hasOK     = (typeof btnOK !== "undefined"),
				    hasCancel = (typeof btnCancel !== "undefined"),
				    hasInput  = (typeof input !== "undefined"),
				    val       = "",
				    self      = this,
				    ok, cancel, common, key, reset;

				// ok event handler
				ok = function (event) {
					if (typeof event.preventDefault !== "undefined") event.preventDefault();
					common(event);
					if (typeof input !== "undefined") val = input.value;
					if (typeof fn === "function") {
						if (typeof input !== "undefined") {
							fn(true, val);
						}
						else fn(true);
					}
					return false;
				};

				// cancel event handler
				cancel = function (event) {
					if (typeof event.preventDefault !== "undefined") event.preventDefault();
					common(event);
					if (typeof fn === "function") fn(false);
					return false;
				};

				// common event handler (keyup, ok and cancel)
				common = function (event) {
					self.hide();
					self.unbind(document.body, "keyup", key);
					self.unbind(btnReset, "focus", reset);
					if (hasInput) self.unbind(form, "submit", ok);
					if (hasOK) self.unbind(btnOK, "click", ok);
					if (hasCancel) self.unbind(btnCancel, "click", cancel);
				};

				// keyup handler
				key = function (event) {
					var keyCode = event.keyCode;
					if (keyCode === keys.SPACE && !hasInput) ok(event);
					if (keyCode === keys.ESC && hasCancel) cancel(event);
				};

				// reset focus to first item in the dialog
				reset = function (event) {
					if (hasInput) input.focus();
					else if (!hasCancel || self.buttonReverse) btnOK.focus();
					else btnCancel.focus();
				};

				// handle reset focus link
				// this ensures that the keyboard focus does not
				// ever leave the dialog box until an action has
				// been taken
				this.bind(btnReset, "focus", reset);
				// handle OK click
				if (hasOK) this.bind(btnOK, "click", ok);
				// handle Cancel click
				if (hasCancel) this.bind(btnCancel, "click", cancel);
				// listen for keys, Cancel => ESC
				this.bind(document.body, "keyup", key);
				// bind form submit
				if (hasInput) this.bind(form, "submit", ok);
				if (!this.transition.supported) {
					this.setFocus();
				}
			}
634597
function() {
            this.$button = $(this.options.templates.button).addClass(this.options.buttonClass);

            // Adopt active state.
            if (this.$select.prop('disabled')) {
                this.disable();
            }
            else {
                this.enable();
            }

            // Manually add button width if set.
            if (this.options.buttonWidth && this.options.buttonWidth !== 'auto') {
                this.$button.css({
                    'width' : this.options.buttonWidth
                });
                this.$container.css({
                    'width': this.options.buttonWidth
                });
            }

            // Keep the tab index from the select.
            var tabindex = this.$select.attr('tabindex');
            if (tabindex) {
                this.$button.attr('tabindex', tabindex);
            }

            this.$container.prepend(this.$button);
        }
342615
private JButton getBtnCancel() {
		if (btnCancel == null) {
			btnCancel = new JButton();
			btnCancel.setText(Constant.messages.getString("alert.add.button.cancel"));
			btnCancel.setEnabled(true);
			btnCancel.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
				    clearAndCloseDialog();
				}
			});

		}
		return btnCancel;
	}
823189
function bgen(lbl, dsc){
		    var b = new bbop.html.button(
  			lbl,
			{
			    'generate_id': true,
			    'type': 'button',
			    'title': dsc || lbl,
			    //'class': 'btn btn-default btn-xs'
			    'class': 'btn btn-primary btn-xs'
			});
		    return b;
		}
1112548
function createActionButton (title, callback, appendTo) {
    appendTo = appendTo || 'buttons';
    var buttons = document.getElementById(appendTo);
    var div = document.createElement('div');
    var button = document.createElement('a');
    button.textContent = title;
    button.onclick = function (e) {
        e.preventDefault();
        callback();
    };
    button.classList.add('topcoat-button');
    div.appendChild(button);
    buttons.appendChild(div);
}
814720
protected Button newButton(final String id)
	{
		return new AjaxButton(id)
		{
			/**
			 * The serialVersionUID.
			 */
			private static final long serialVersionUID = 1L;

			/**
			 * Listener method invoked on form submit with errors
			 *
			 * @param target
			 * @param form
			 */
			@Override
			protected void onError(final AjaxRequestTarget target, final Form<?> form)
			{
				SigninFormPanel.this.onSignin(target, SigninFormPanel.this.form);
			}


			/**
			 * {@inheritDoc}
			 */
			@Override
			public void onSubmit(final AjaxRequestTarget target, final Form<?> form)
			{
				SigninFormPanel.this.onSignin(target, SigninFormPanel.this.form);
			}
		};
	}
1277855
protected function InitForm()
    {
        $this->submit = $this->LoadElement();
        
        $this->AddNameField();
        $this->AddValueField();
        
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
401057
private void addDefaultSubmitButtonExample() {
		add(new WHeading(HeadingLevel.H3, "Default submit button"));

		add(new ExplanatoryText(
				"This example shows how to use an image as the only content of a WButton. "
				+ "In addition this text field submits the entire screen using the image button to the right of the field."));
		// We use WFieldLayout to lay out a label:input pair. In this case the input is a
		//compound control of a WTextField and a WButton.
		WFieldLayout imageButtonFieldLayout = new WFieldLayout();
		imageButtonFieldLayout.setLabelWidth(25);
		add(imageButtonFieldLayout);
		// the text field and the button both need to be defined explicitly to be able to add them into a wrapper
		WTextField textFld = new WTextField();
		//and finally we get to the actual button
		WButton button = new WButton("Flag this record for follow-up");
		button.setImage("/image/flag.png");
		button.getImageHolder().setCacheKey("eg-button-flag");

		button.setActionObject(button);
		button.setAction(new ExampleButtonAction());
		//we can set the image button to be the default submit button for the text field.
		textFld.setDefaultSubmitButton(button);
		//There are many way of putting multiple controls in to a WField's input.
		//We are using a WContainer is the one which is lowest impact in the UI.
		WContainer imageButtonFieldContainer = new WContainer();
		imageButtonFieldContainer.add(textFld);
		//Use a WText to push the button off of the text field by an appropriate (user-agent determined) amount.
		imageButtonFieldContainer.add(new WText("\u2002")); //an en space is half an em. a none-breaking space \u00a0 could also be used but will have no effect on inter-node wrapping
		imageButtonFieldContainer.add(button);
		//Finally add the input wrapper to the WFieldLayout
		imageButtonFieldLayout.addField("Enter record ID", imageButtonFieldContainer);
	}
295985
public function btnSubmit($title = '', $options = [])
    {
        $title = empty($title) ? __('Submit') : $title;
        $options = array_merge([
            'class' => 'btn btn-success',
            'type' => 'submit',
        ], $options);
        return parent::button($title, $options);
    }