# Button

## Introduction

In XForms, buttons are called "triggers" and use the `<xf:trigger>` element. A special button directly tied to a submission is called "submit" and uses the `<xf:submit>` element.

## Full appearance

### Description

This is the default appearance of a button.

![](/files/-LEkC7VegOyX4PU7WZ7p)

### Usage

```markup
<xf:trigger>
  <xf:label>My Button</xf:label>
</xf:trigger>
```

```markup
<xf:submit submission="my-submission">
  <xf:label>Submit</xf:label>
</xf:submit>
```

or:

```markup
<xf:trigger appearance="full">
  <xf:label>My Button</xf:label>
</xf:trigger>
```

```markup
<xf:submit submission="my-submission" appearance="full">
  <xf:label>Submit</xf:label>
</xf:submit>
```

## Minimal appearance

### Description

The `minimal` appearance creates a button which appears like a link.

![](/files/-LEkC7VhayeOoabFrHZh)

### Usage

```markup
<xf:trigger appearance="minimal">
  <xf:label>My Link Button</xf:label>
</xf:trigger>
```

## Other appearances

When the trigger has the `full` appearance, the following additional appearances are supported:

* `xxf:primary`
* `xxf:info`
* `xxf:success`
* `xxf:warning`
* `xxf:danger`
* `xxf:inverse`
* `xxf:mini` (SINCE Orbeon Forms 2016.3)
* `xxf:small` (SINCE Orbeon Forms 2016.3)
* `xxf:large` (SINCE Orbeon Forms 2016.3)

![](/files/-LEkC7WAN_RHV1rsLgEQ)

These appearances are mutually exclusive. They match corresponding [Twitter Bootstrap button classes](http://getbootstrap.com/2.3.2/base-css.html#buttons).

Example:

```markup
<xf:trigger appearance="xxf:primary xxf:mini">
  <xf:label>My Button</xf:label>
</xf:trigger>
```

## Creating a button with embedded images and markup

\[TODO]

## Modal trigger and submit

Usually, activating a trigger or submit button on the client doesn't prevent further actions in the user interface. Sometimes however it is useful to block such actions until further processing is complete, for example calling a submission that saves a document.

![](/files/-LEkC7WFV-SdixVHqhyq)

You can obtain this behavior by using the `xxf:modal="true"` attribute on `<xf:trigger>` and `<xf:submit>`:

```markup
<xf:trigger xxf:modal="true">
    <xf:label>Save</xf:label>
    <xf:send ev:event="DOMActivate" submission="save-submission"/>
</xf:trigger>
```

With this attribute set to true, user input is blocked until all the events triggered by `DOMActivate` are processed. In the meanwhile, the page is grayed out and an icon appears indicating that background processing is taking place.

As soon as users activate (press enter or click) on a modal trigger or submit, the corresponding button loses the focus. This prevents users from being able to press enter and thus activate a button which still has the focus, while screen is grayed out.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.orbeon.com/xforms/controls/trigger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
