Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

HTML Form to Replace Information in the Document

Fabio Galera
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 26, 2018

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

0 votes
Tim Terfort
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 22, 2022

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
AUG Leaders

Atlassian Community Events