top of page

Format Custom Javascript Buttons the Easy Way - MicroStrategy


I've previously posted a few sample of creating custom javascript buttons in MicroStrategy, typically for Documents. For example - Excel or PDF Export Button (and more to come). The HTML buttons trigger the custom Javascript but getting the HTML button formatted just right isn't always easy for a few reason.


There is a simple trick to get around having to format the button in HTML and use native out-of-box MicroStrategy functionality. Set the HTML button to transparent and overlay it on top of a native MicroStrategy button. This way you can format the button using MicroStrategy but get the custom functionality you're looking for. I've set the transparency in the snippet below.


Sample code below;


<script>

function jsTesting() {

alert("OmarVidaure.com")

}

document.getElementById("applyBtn").addEventListener("click",jsTesting);

</script>


<form name="applyForm">

<input id="applyBtn"

type="button"

style="border-width: 0pt;

height: 200px;

width: 200px;

cursor:Pointer; cursor: hand;

background-color: Transparent"

></p>

</form>

</script>


And that's it!

 

Thanks for checking out this blog post. If you found this post helpful please consider donating via PayPal. Any contribution is appreciated!



1,821 views2 comments

2 Comments


Omar Vidaure
Omar Vidaure
Feb 26, 2020

In this case, don't add any text and keep the button as transparent. This will allow you to overlay this transparent button over any object you'd like and give the button functionality. My favorite part about this is that you wont have to worry about your HTML scaling.

Like

SAI rags
SAI rags
Feb 26, 2020

Hi Omar, adding style="opacity:.09" will help in hiding the text to the maximum extent?

Like
bottom of page