Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Simple way to toggle a reset of all confiforms fields

Looking for a simple way for an end user to toggle a reset of all fields on a form. I know that the Confiforms rule "reset" will achieve this to an extent, however, I'd love to have a JavaScript driven button float at the bottom of the form so the end user has easy access to a reset function. Is this doable? Any help is appreciated, thanks!

2 answers

1 accepted

2 votes
Answer accepted

Hi Jason!

Great question!

Well, you can easily add anything you want into the "form dialog initialization", including something like an "extra button" with custom function

See the quick demo below 

Hope it helps


This is exactly what I was looking for. As for the function to reset the field values, my JS is far from excellent, how would I go about doing that in the function?

A lot depends on what field you want to reset... 

Could be as easy as (for many field types it works)

AJS.$('#' + formId).find('#i_mytext').val('');

(where "mytext" is my text field value on a form)

And much more complicated is to reset "drawing canvas" in ConfiForms, and some other field types...

This is perfect! Implemented and works as intended. Thanks so much Alex!

@Alex Medved _ConfiForms_  I followed this solution however it is hiding the entire form and now I am only seeing the paragraph above the form and form isn't showing on the page.

I am doing it as a Rendering Form as Embedded. Is there a solution that works with the rendering form as embedded where I can still add a reset button?

I did include the  code you used in the example at the bottom within the ConfiForms field definition box. 

Sorry, hard to tell anything without seeing what you have implemented. 

If you follow the demo precisely then you will get the results demonstrated

Let me provide some more detail then to show how I built my form.

I have at the top ConfiForms (FormView Registrations Control)

ConfiForms Form Name:TARF

Rendering Form as: Embedded 

Label for Registration Button:Submit

Override Label for Save Button: Submit

Override Label for form Close Button: Reset

Message to show after a record has been created: Your Form has been submitted 

Execute custom Javascript function after the form is loaded: myCustomScript(formId);

Within the Confiforms Form Registrations Controls 

I have Confiforms fields over 10 of them including Title, Type of Request, Product, etc.

Separate from the above below it

I have ConfiForms Form definition with over 10 of them including Title, Type of Request, Product, etc.

And underneath that I have the HTML macro that has the javascript listed in your demo.

The issue I’m having is when I put in the information I no longer see ConfiForm fields on the confluence page after I publish it they go away and are becoming hidden after adding Execute custom Javascript function after the form is loaded myCustomScript(formId)

The ConfiForm fields/request form only displays everything when I select rendering for as a button. It hides.  The ConfiForm fields/request form on the page when I select rendering for embedded.

But I need to be able to see the request form on the page and then at the bottom submit button and reset button when the user goes to the page.

Same example, as originally posted, but with the embedded form

As noted earlier - works absolutely the same way


Like Loren likes this

Thanks a lot Alex. I do now see a Reset button next to Submit on my form in Confluence. After following your embedded demo.

But one more question 

AJS.$('#' + formId).find('#i_mytext').val('');

As you mentioned here somewhat higher on this page and in this example . Now with my reset button how do I get it to  for example reset  ConfiForm field definition  Field Name Apps Field Label Software Field Type Drop down

Connected to it

confiform field

field name Apps

Override Label Software Apps

 Where the reset button resets the Confiform fields.


You can either use/add the JS code as in the demo

AJS.$('#' + formId).find('#i_mytext').val('');

Changing mytext to match your field names or by using our APIs/code

function cfSetValue(formId, fieldName, fieldValue, isAdvanced = false)

Rewriting the example above with mentioned functions

cfSetValue(formId, 'mytext', '');

Resetting the value of an advanced dropdown should be done via

cfSetValue(formId, 'mydropdownfield', '', true);


Like Loren likes this

Thanks again Alex. The JavaScript solution worked on my form for fields with drop downs and the fields that are text area (the reset button is working for that) except it's not working for the field names that are field type multi select or text box group.  Do I need to add something additional for multi select and text box group field types for the javascript solution?


Try with "advanced" flag set to true

cfSetValue(formId, 'mydropdownfield', '', true);

 for multi-select fields.

Not sure though what is a "text box group" field


Like Loren likes this

I meant to say field type Checkbox Group not Text box group.


<script type="text/javascript">

function my CustomScript(formId) {

AJS.$('#' + fomdId).find('.save-cf-btn').after('<button type="button"` class="aui-button cf_reset_btn" style="margin=right: 10px;">Reset</button>');
AJS.$('#' + formID).find('.cf_reset_btn').click(function() {
 AJS.$('#' + formID).find('#i_totr').val('');
 AJS.$('#' + formID).find('#i_title').val('');

function cfSetValue(formId, 'my multiselect field', '',
}); }



The above code is working in resetting the drop down fields and text fields (with the reset button) but its not working in resetting the multi select and checkbox group fields. I tried doing the above. What do I need to change regarding cfSetValue function, for this to work?  



Your solution you listed on October 15th is now working on my form. Thanks again Alex.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events