Adding Radio Buttons to Confluence - How?
Asked by Mick Davidson:

Is it possible to add radio buttons to a page and/or a template in Confluence?

I'm assuming that it is, but it has to be coded. If that's the case, what would I have to add?

Please bear in mind that I am not a developer.

Cheers,


Answers:
author: Daniel Borcherding
body: Hello Mick,

What would you like the radio buttons to do? You can add raw html to the page from the html-include macro. The state of the radio buttons would not be remembered from page load to page load. What kindof data are you trying to capture with radio buttons?

comments: author: Mick Davidson
body: Daniel,

thanks. We're not setup to use HTML (isn't that a site-wide change that has security implications?).

Also, I think we'd want the radio button to remember it's previous state.

Cheers.


author: Daniel Borcherding
body: Mick,

You can use the html macro to embed raw html inside of your Confluence pages. I don't believe that this would have security implications as you are not allowing anonymous users to insert arbitrary bits of html. Use of the macro would be restricted to the user population you have set up in Confluence.

What data are you trying to capture with the radio button? I agree that they would be a bit useless without the ability to remember their state. My purpose in asking this first question is to determine if there is a plugin in our marketplace or built into Confluence already that has the functionality you need. If there is such a thing I would like to direct you at that rather than trying to build a custom solution.

Please let us know what you are trying to get out of Confluence and we are more than happy to try to point you at the right tool.


author: Mick Davidson
body: Daniel,

Thay's great, thanks for the info and clarification. I have to talk to the person who wants the radio buttons about the permanancy and what they are trying to achieve and get back to you.

I was assuming that there was nothing already built in as I couldn't find anything in Insert/Other Macros. But if there is, great. We're happy to use external plugins, but are often unhappy with the cost of doing so. We have a 2k person licence and are reluctanct to pay to get a licence for 2k people when only a handful will use the functionality.

Cheers


author: Philippe PEREZ
body: Hello,

My team looks for having radio button too (this is what lead me to this page :))

The purpose is: indicate on a page accessible to all our customers who is the the active Point of Contact within the team. We are rotating this role amongs us, sometimes multiple times in the day, and a radio button would be faster than editing the page each time to change the name.


author: Philippe PEREZ
body: Hello,

My team looks for having radio button too (this is what lead me to this page :))

The purpose is: indicate on a page accessible to all our customers who is the the active Point of Contact within the team. We are rotating this role amongs us, sometimes muliple times in the day, and a radio button would be faster than editing the page each time to change the name.

comments: author: Brendan Ford
body: Philiipe,

What might work for you is to have a set of checkboxes; those do keep state between page loads.

If you want customers to be able to modify the settings, then they will need write access to the page. Be sure that you are careful about setting up write permissions for only those that you want to be able to check the checkboxes though because every click of the checkbox essentially saves a new revision of the page, even with explicitly editing, which also serves as tracking for when/when the checkboxes changes (via Page History).

I am also looking for a persistent radio button which is why I stumbled upon your question. I have come to the conclusion that there isn't one, but I think I am going to make 'faux' radio buttons using checkboxes in groups with some javascript to uncheck all other in a group. Maybe some CSS to make the boxes round too.  
If such a solution would be useful to you also, reach out to me and I can show you the solution I come up with.

I hope that is helpful to you.

P.S. Just realized that your post is from 2014, so I'm not expecting a response :)


author: Andreas Hippel
body: Brendan,

While also looking for a persistent radio button I stumbled upon this discussion. Your solution with automatic unchecking other checkboxes sounds very interesting to me.

So can you post your solution? That would be really helpful!

Thank you!


author: Michiel Nieuwstraten
body: Try typing \[ followed by \] while in editor. I don't know since what version this works...

comments: author: Philippe PEREZ
body: Thanks Michiel.Unfortunately this includes a task (at least in 5.5.3), which can be basically used as a check box, but not a radio button.Anyway it can be a workarround for our purpose. Nice idea.


Tags: radio-button