Pop-Ups

Usage

  • A pop-up is used to show a message, ask input or make a choice

  • A pop-up can have multiple buttons or a custom layout

Creating pop-ups

<pop-up id='dialog'></pop-up>

Attributes

Item
Desscription
Value

title

The title of the pop-up

String

message

The message to be shown

String

backdropClose

Whether the user can close the pop-up by clicking on the backdrop

Boolean

cancelText

The text the cancel button will be given

String

submitText

The text the submit button will be given

String

action

The page to send the data to

.php page

If action attribute is used a Javascript FormData object will be send to the onSubmit event, nevertheless this event will always fire no matter what action is set

Functions

Function
Description
Input
Output

closePopup()

Closes the popup

HTML <pop-up> element

openPopup()

Opens the popup

HTML <pop-up> element

Events

Event
Description
Output

onSubmit

Fires when a the submit button was clicked

FormData object

popupCancelled

Fires when the popup was either closed or cancelled

Last updated