Try it
  • Examples
  • Features
  • Testimonials
  • Partners
  • Pricing
  • Support
    • Sintel Apps Help
    • Sintel Apps Release History
    • Sintel BI Help
    • Sintel BI Release History
    • Webinars
    • How to video series
    • Ask the community
    • Submit a ticket
    • Request a demo
    • Compare us
  • Blog
  • Examples
  • Features
  • Testimonials
  • Partners
  • Pricing
  • Support
    • Sintel Apps Help
    • Sintel Apps Release History
    • Sintel BI Help
    • Sintel BI Release History
    • Webinars
    • How to video series
    • Ask the community
    • Submit a ticket
    • Request a demo
    • Compare us
    • For Schools
  • Blog
  • Get Started
How can we help?

Search for answers or browse articles about Sintel Forms

Filter by categories Clear Results
  • About Sintel Forms

    • SharePoint List types supported by Sintel Forms
    • What is Sintel Forms
    • Why we built it
    • Sintel Apps and the security of your data
  • Getting Started

    • How to Install Sintel Forms
    • Adding Sintel Forms to a SharePoint Site
    • Authorizing Sintel Forms
    • Install Sintel Forms for SharePoint On-Prem
    • Sintel Forms Best Practices
  • Product Updates

    • Release History
    • Updating Sintel Forms for SharePoint On-Prem
    • Differences between the Cloud and On-Prem Versions of Sintel Forms
  • Settings

    • External Access Settings

      • Understanding External Access Settings in Sintel Forms
      • External Submissions
      • External Collaboration
      • External Sharing
      • External Access Settings
    • After save script
    • Basic Features
    • Conversations
    • Form Viewer
    • Hide Sintel Branding
    • Payments
    • Theme & Styling 
    • Confirmation screens
    • Localisation
    • How to avoid SharePoints list view threshold
  • Layout

    • About Layout
    • Adding and Editing Linked List items using Inline, Dialog & Sintel Forms Embedded
    • Adding Fields
    • Creating Calculated Fields & Using Formulas
    • Default values & custom values
    • Field and Section Validation
    • Linked Libraries-Using a Document/Picture Library
    • Linked Lists-How to add attachments
    • Sections - Tab order
    • Setting field properties within a Linked List
    • Using a Linked List
    • Form Header and Footer
    • New "Cosy" Form Interface
  • Workflow

    • About Workflow
    • Workflow: Statuses
    • Workflow: Actions
    • Workflow: Email
    • Workflow: Payment Actions
    • Deprecation of the SintelFormsWorkflow list
  • Logic

    • About Logic
    • Logic: Steps
    • Logic: Conditions
    • Logic: Rules
  • Reminders

    • Reminders
  • Basic Customisation

    • Applying a theme and adding icons or graphics
    • Changing button colours or hiding them
    • Embedded Action Buttons (deprecated)
    • Customising Send-From Address for Sintel Apps Emails
  • Advanced Customisation

    • The JavaScript API

      • Articles coming soon
    • Accessing external APIs
    • Creating custom buttons using JavaScript
    • Custom form styling using CSS
    • Programmatically creating Sintel Forms
    • The JavaScript API
    • Using query string parameters for default/calculated values
    • Restrict access to users not found in a SharePoint group
    • Advanced Customisation and Code Samples
    • Advanced Customisations: Quick Navigation Guide
  • FAQs

    • FAQs
    • Activating Sintel Forms on newly created tenants
    • Lists and columns used by Sintel Forms
    • Support and Training
    • Track the usage of Sintel Forms
    • Differences between the Cloud and On-Prem Versions of Sintel Forms
    • Permissions used by Sintel Forms
    • Permissions required to use the Sintel Forms Designer
    • SharePoint Add-Ins are retiring what can you do
  • How To Guides

    • Automatically add linked items or files
    • Change the layout of Choice Fields
    • Configure a cascading drop-down
    • Configure Printing Options
    • Debugging your forms
    • Embedded Action Buttons (deprecated)
    • Export a form template
    • How to complete a form action with Power Automate
    • Import a form template
    • Lookup Columns: Control the sort order
    • Lookup Columns: Retrieve additional columns from Lookup List
    • Make Attachments Mandatory
    • Set & clear field values using rules
    • Share a Form
    • Track the usage of Sintel Forms
    • Transferring your license to another tenant
    • Use Sintel Embedded Mode on a linked list
    • Use a Rule to check if third party cookies are enabled
    • Customising Send-From Address for Sintel Apps Emails
    • Recommended Permissions For Forms and Apps
    • Disable Sintel Forms on a list
    • Show all articles ( 6 ) Collapse Articles
  • Widgets

    • Buttons
    • Workflow History
    • HTML Widget
  • Noteworthy Features

    • Attachments and Image Previews
    • Image Annotations
    • Ink Signatures
    • Sintel Forms Mobile App
    • Workflow History
  • Troubleshooting

    • The redirect URL specified in the request does not match
    • Everything is fine but we had a small problem getting your license
    • "401 Unauthorized" error during form data save
    • "500 internal server error" on form opening
    • Activating Sintel Forms on newly created tenants
    • Ad blockers and Privacy Extensions
    • Attachments option missing in Sintel Forms
    • Changing the Content Approval settings of a list can cause an issue with Sintel Forms
    • Enabling third-party cookies
    • Handling the list view threshold for the Workflow and Conversations features
    • No actions appearing in the actions menu
    • Sintel Forms doesn't appear to be applied to a list
    • Sintel Forms Designer not available in the list command bar
    • Sintel Forms Save Process
    • Site naming and Sintel Forms
    • The remote server returned an error: (401) Unauthorized when importing a form template
    • Workflow emails containing incorrect links to forms
    • Workflow emails not being received by distribution lists or mail-enabled security groups
    • Workflow emails not being received by SharePoint group members
    • Data load error: Connection to SharePoint has been lost. Please reload the page.
    • Data save error: Access denied. You do not have permission to perform this action or access this resource
    • Email address of a Shared Mailbox not recognised by Sintel Forms
    • Add an exception for Sintel Forms instead of enabling third-party cookies
    • Export to PDF not working on SharePoint Subscription Edition
    • "404 FILE NOT FOUND" when attempting to open a new form or existing form
    • Show all articles ( 10 ) Collapse Articles
  • Code Samples

    • Embedded Action Buttons (deprecated)
    • Set email address from person field
    • Validate email addresses
    • Advanced Customisation and Code Samples
    • Advanced Customisations: Quick Navigation Guide
  • Sintel General Info

    • What we do
    • Who we are

Creating custom buttons using JavaScript

Posted6 August 2020
Updated6 August 2020
ByEoin McMahon
You are here:
  • Main
  • Advanced Customisation
  • Creating custom buttons using JavaScript
1.8 out of 5 stars

6 ratings

5 Stars 17%
4 Stars 0%
3 Stars 17%
2 Stars 0%
1 Stars 67%
< All Topics
The addCustomButton function will become available in the upcoming version of Sintel Forms (v.1.27). The old way of adding custom buttons is still available in the 2nd part of this article.

Using the logic feature, you can create your own custom buttons that will appear in a form and define their behaviour:

In order to achieve that, you need to use the addCustomButton() JavaScript function in one of the form’s logic rules. Here are some example calls of the function:

// Example A: button with a "Link" icon type, which link will be opened in the same tab as the form: 
addCustomButton("A custom button", "Link", "https://www.some-web-address.com"); 

// Example B: button with a "SetAction" icon type, which link will be opened in a new tab:
addCustomButton("Another custom button", "SetAction", { url: "https://www.some-web-address.com", target: "_blank" }); 

// Example C: button with a "FavoriteStar" icon type, with a custom onClick code: 
addCustomButton("Button with custom action", "FavoriteStar", function() { alert("Button has been clicked!") });

 

The addCustomButton() function accepts following parameters:

  • label of the button
  • icon type of the button. You can browse all available icon types on Microsoft’s Fluent UI icons page.
  • behaviour of the onClick action:
    • if it’s a string value, the page will be redirected to the provided string URL
    • if it’s an {url, target } object, the page will be redirected to the string URL from the url property, using the target defined in the target property.
    • if it’s a js function, it will simply be invoked on click

—

Using fully-custom js and css:

You can use the Logic feature to call custom JavaScript code that can manipulate the content of a form. This can be used to inject custom buttons into form’s layout.

You can download a form template containing the below example here.

Invoking custom JavaScript code – if used incorrectly – might even totally break the form. Make sure you know what you’re doing.

 

Example: injecting a button into the toolbar

 

Step 1: creating a custom style for the button

In order to make sure that the button looks similar to other buttons, you can style it by creating a custom CSS in the Custom HTML property of any section in the form:

<style>
.custom-button{
	background-color: transparent;
	color:  #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	height: 100\%; 
	padding: 0 8px;
	display: flex;
	align-items: center;
}

.custom-button:hover {
	color:  #333333;
	background-color:  #EAEAEA;
}

.custom-button:active {
	background-color:  #C8C8C8;
}
</style>

This style is being applied to a “custom-button” CSS class, that we will have to apply to our button later.

 

Step 2: creating a custom button in JS code

We will create a new rule in the Logic section, and put a single “Execute custom js” step there, with the following code:

const customButtonId = "customButton1";

let buttonAlreadyExists = document.getElementById(customButtonId);

if (!buttonAlreadyExists) {

	let customButtonDiv = document.createElement("div");
	customButtonDiv.id = customButtonId;
	customButtonDiv.className = "custom-button";
	customButtonDiv.innerHTML = "I am a custom button.";

	const customButtonsRoot = document.getElementById("custom-buttons-root");

	customButtonsRoot.appendChild(customButtonDiv)

	customButtonDiv.onclick = () => {		
		alert("The button has been clicked!");
	};

}

 

The code creates a new button and appends it to the “custom-buttons-root” HTML element, which is located right after all the toolbar buttons of the form.

Result:

custom.button.gif

Was this article helpful?
1.8 out of 5 stars

6 ratings

5 Stars 17%
4 Stars 0%
3 Stars 17%
2 Stars 0%
1 Stars 67%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents

Sintel Apps

Create apps on Microsoft 365 in minutes with no code.

Address

River House
Blackpool Park,
Cork, T23 R5TF,
Ireland

Support

  • Product help
  • Community site
  • Submit a ticket
  • Compare us

    Contact us to

    • Book a demo
    • Request a license
    • Become a partner

    e-mail: info@sintelapps.com
    tel: +353 (0) 21 245 2935

    Follow us

    • Follow
    • Follow
    • Follow

    © Copyright 2026 | End User License Agreement | Privacy Policy | Terms Of Use

    Sintel Apps
    Sintel Apps Assistant
    Get instant answers and support
    Connecting to Sintel Apps Assistant…
    Sintel is thinking…
    We use cookies to collect and analyse information about the users of this website. Please click 'I accept' to consent to the use of this technology.