Forums

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

How do you using a reset button in javascript reset fieldtypes that are multiselect & checkbox group

Loren
Contributor
October 18, 2022

I did follow a javascript solution to create a reset button and the reset button is resetting the field types that are the field type drop down, text and date. But it is not working on resetting the fields that are multi select and checkbox group. I am doing it in confluence with Confi forms. And the below is a sample of some of the code I am using for it. I put the code in html macro in confluence.

<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('');
  });
}

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
October 19, 2022

Hi

I thought I have explained that in the other question...

Here is a demo of what I was trying (hard) to explain:

http://recordit.co/OtWXFJEZ7B

Hope it helps

Alex

Loren
Contributor
October 20, 2022

Thanks so much again Alex. It's working now. My formatting was a little off before. But now it's working and the multi select and checkbox group are resetting as well with the reset button.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events