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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

377 views 16 9
Join discussion

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