Can you mask data under a switch?

I'd like to display a phone number on a page, but I want the characters masked under a switch.

In other words, I want to display a phone number like this:

(***) ***-**** with a checkbox next to it that, when checked, reveals the actual number like this:

(360) 555-1212

No security issues. Just want to mask certain text by default requiring an extra click to reveal.

2 answers

1 accepted

Hey Ken,

I could not mask as you would like, but would not be too difficult, just need to adapt my User Macro.

You'll need to create a custom macro with the following settings (the required ones):

  1. Name
  2. Title
  3. Rendered
  4. And the Code
    ## @param Name:title=Link|type=string|required=true|desc=Link to Click
    <script language="javascript"> 
    function toggle() {
    	var ele = document.getElementById("toggleText");
    	var text = document.getElementById("displayText");
    	if( == "block") {
 = "none";
    		text.innerHTML = "$paramName";
    	else { = "block";
    		text.innerHTML = "hide";
    <a id="displayText" href="javascript:toggle();">$paramName</a>
    <div id="toggleText" style="display: none"><h1>$body</h1></div>

Please modify it to your needs, the usage would be, type {hide and select it from the drop-down. Then fill the link you'd like for people to click, could be "Click Me" or "Click to show my Number", and save. Then Place the number or text inside the block of code. And its done.

Hope this helps you, Cheers,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,619 views 4 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you