I am using AUI to create a form with the HTML macro in a Confluence page. When the save button is clicked, I want it to either save to a text file or save it to JSON. I have used JavaScript for this, which works fine in my testing areas, but does nothing from the Confluence form. Is there a workaround to save form data?
Hi @Sondra Menthers .
Could you share the code snippet or create a https://jsfiddle.net/ that would show what you're trying to do?
I uploaded the code here
https://jsfiddle.net/sondramenthers/pt27ndhg/
Of course, it is returning nothing because it is supposed to get the data from the form which I wrote using the AUI class which is all in HTML. The code for the button is
</div>
<!--Add to button to save the data.-->
<div>
<input type="button" id="bt" value="Save data to file" onclick="saveFile()"
</div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, you certainly cannot save the form's data into a file.
But what you can try to do is to handle form submit in a way that creates a file on-the-fly and uses Confluence REST APIs and submits it as an attachment (basically uploading "submitted" data as an attachment on to some page)
If you want something more sophisticated then you need to create a "backend service" that handles your form submits and does what you want. You can always create a custom plugin for Confluence - https://developer.atlassian.com/server/framework/atlassian-sdk/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Creating it on the fly is fine. Ideally, I would like the attachment to be emailed or slacked but that might be too difficult.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I am pretty sure you can use slack APIs to send a message right from the browser, they do have web API
I briefly looked at the jsfiddle (not my business really and dont want to interrupt your conversation), and I suggest to take a look at what Confluence has to offer - https://confluence.atlassian.com/confkb/how-to-use-javascript-in-confluence-313458839.html
easier to use with jquery they have, and toInit method is also a nice thing to do (things properly)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is a lot easier than this answer https://community.atlassian.com/t5/Jira-questions/How-to-add-options-to-aui-select-via-JavaScript/qaq-p/673523
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.