> For the complete documentation index, see [llms.txt](https://docs.northcommerce.com/north-commerce/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.northcommerce.com/north-commerce/for-developers/flows/flow-events.md).

# Flow Events

For example you can setup an add to cart event or create customer event by doing a simple click event like this:

```
 <?php $cart_quantity_flow->attr('event', 'click') ?>
```

You need to declare that you are wanting to set an event and then in the second argument you declare which event you would like to use

### Event List

Mouse Events

* `click`: Triggered when an element is clicked.
* `dblclick`: Triggered when an element is double-clicked.
* `mousedown`: Triggered when a mouse button is pressed down over an element.
* `mouseup`: Triggered when a mouse button is released over an element.
* `mousemove`: Triggered when the mouse pointer is moved while it is over an element.
* `mouseover`: Triggered when the mouse pointer enters an element.
* `mouseout`: Triggered when the mouse pointer leaves an element.

Keyboard Events

* `keydown`: Triggered when a key is pressed down.
* `keypress`: Triggered when a key is pressed and released.
* `keyup`: Triggered when a key is released.

Form Events

* `focus`: Triggered when an element gains focus.
* `blur`: Triggered when an element loses focus.
* `change`: Triggered when the value of an element changes.
* `submit`: Triggered when a form is submitted.
* `reset`: Triggered when a form is reset.

Window Events

* `load`: Triggered when the page has finished loading.
* `unload`: Triggered when the user exits the page.
* `resize`: Triggered when the browser window is resized.
* `scroll`: Triggered when the user scrolls the page.

Touch Events

* `touchstart`: Triggered when a touch point is placed on the touch surface.
* `touchmove`: Triggered when a touch point is moved along the touch surface.
* `touchend`: Triggered when a touch point is removed from the touch surface.
* `touchcancel`: Triggered when a touch interaction is interrupted.

Drag and Drop Events

* `dragstart`: Triggered when the user starts to drag an element.
* `drag`: Triggered while an element is being dragged.
* `dragend`: Triggered when the user stops dragging an element.
* `dragenter`: Triggered when a dragged element enters a drop zone.
* `dragover`: Triggered while a dragged element is over a drop zone.
* `dragleave`: Triggered when a dragged element leaves a drop zone.
* `drop`: Triggered when a dragged element is dropped in a drop zone.

Other Events

* `error`: Triggered when an error occurs while loading an external resource.
* `contextmenu`: Triggered when the user right-clicks on an element.
* `select`: Triggered when the user selects some text.
* `wheel`: Triggered when the user rotates the mouse wheel.
* `storage`: Triggered when a change is made to the local storage.
* `online`: Triggered when the browser comes online.
* `offline`: Triggered when the browser goes offline.

This list is not exhaustive, but it covers the most commonly used JavaScript events.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.northcommerce.com/north-commerce/for-developers/flows/flow-events.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.
