Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,604
Community Members
 
Community Events
165
Community Groups

HTML Form to Replace Information in the Document

Hello folks,

 

I have a confluence Space which have many STEP-by-STEP procedures for implementing servers, network, etc. 

One of our pains right now, is to change the COMMANDS to reflect to correct names, servers, and configuration.

I came with the idea of Creating a FORM in top of the page with some INPUT on that, like SERVERNAME, USERNAME, etc

and in the documentation it self, I used some tags <%SERVERNAME%> and <%USERNAME%>:

...
<omitted>
-- Connect using the username in the server
$ ssh <%USERNAME%>@<%SERVERNAME%> 
...
<omitted>
...

Using HTML Macro, I was able to create the form and the javascript&colon;

 

<script type="text/javascript">
function RefreshPageContent(x) {
console.log(x.getElementsByTagName("input"))
}
</script>

<form class="aui" id="FormToRefresh">

<div class="field-group">
<label for="text-input">Servername</label>
<input class="text" type="text" id="SERVERNAME" title="ServerName">
<div class="description">ServerName</div>
<input class="text" type="text" id="USERNAME" title="Username">
<div class="description">Username</div>
</div>

</form>

<button class="aui-button aui-button-primary" onclick="RefreshPageContent(self.document);" id="RefreshDetails">Refresh</button>

 

The problem now is how to access the main document to replace the BODY ? As It use iFrame, I cant access outside of it, and if I put the function out, I cant access it as well.

1 answer

Four years later, looking for the same. Did you find a solution for this use case?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

287 views 2 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you