Example. Simple Text Modal
Launch a modal with a text body.
BSDialog5.Show({
ID: "modalL1",
Title: "Modal Title",
Message: "Hello Momo!",
URL: null,
Size: "md",
Colour: "secondary"
});
Example. Update Modal
Make changes (title, body, size or footer) to a modal.
BSDialog5.Update({
ID: "modalL1",
Title: "Modal Changed Title",
Body: "Hello momo again!",
URL: null,
Size: "lg",
Footer: null
});
Example. Multiple Modals (Stack)
Launch multiple modals, stacked on top of each other.
BSDialog5.Show({
ID: "modalL3a",
Title: "Modal A Title",
Message: "First!",
URL: null,
Size: "md",
Colour: "secondary"
});
BSDialog5.Show({
ID: "modalL3b",
Title: "Modal B Title",
Message: "Second!",
URL: null,
Size: "md",
Colour: "secondary"
});
Example. Button Prompt (Modal)
Launch a modal with a prompt of several buttons. Modal waits for a response from one of the buttons.
let response = await BSDialog5.Prompt({
Title: "Modal Title",
Message: "Are you sure want to wait for a response?",
Size: "md",
Buttons: [
{ Label: "Yes", Value: "Yes", Colour: "primary" },
{ Label: "No", Value: "No", Colour: "secondary" },
{ Label: "Cancel", Value: "Cancel", Colour: "secondary" }
]
});
alert(response);
Example. Text Prompt (Modal)
Launch a modal with a text prompt. Modal waits for a response from the textbox.
let response = await BSDialog5.Prompt({
Type: "textbox",
Title: "Modal Title",
Message: "Are you sure want to wait for a response?",
Size: "md",
Label: "",
Placeholder: ""
});
alert(response);
Example. Close Modal
Close a modal using its identifier
BSDialog5.Close("modalR1");
Example. Clear Modal
Close all modals
BSDialog5.Clear();