Is it possible to hide the submit button on a ConfiForms form?

Pam Weber September 25, 2020

Some users are clicking on the Submit button on ConfiForms forms before they finish the form.  This results in several incomplete entries being written to the ConfiForms data table.  Is there a way to hide the Submit button until the user has completed the form?

Thanks.

Environment

  • ConfiForms 2.13.9
  • Confluence Server 6.15.9

3 answers

1 accepted

0 votes
Answer accepted
Pam Weber January 8, 2021

This is the solution we came up with. 

1.  Placed the following JavaScript within an HTML macro on the page where the form is defined.

<script>
function showSaveButton(){
  AJS.$('button.save-cf-btn').show();
} 
function hideSaveButton(){
  AJS.$('button.save-cf-btn').hide();
}
</script>

2. Added a Checkbox field (called cfConfirm) to the form with a description that asks the user to check the box to confirm that they have finished filling in the form.  (Alternately, we could set the value of the checkbox field to true using a field definition rule when the last user-provided field is valued, but we decided we wanted to ask the user if they were done filling in the form.)

3. Defined 2 field definition rules within the form that test the checkbox field and call the appropriate javascript function: 

  • Rule 1:  
    • Field Name = cfConfirm
    • Condition = cfConfirm:true
    • Action = Run custom JavaScript
    • JavaScript to run = showSaveButton();
  • Rule 2:  
    • Field Name = cfConfirm
    • Condition = cfConfirm:false
    • Action = Run custom JavaScript
    • JavaScript to run = hideSaveButton();

Hope this helps others out there with the same need.

1 vote
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2020

Hi

Why not to implement validation rules to ensure that the user fill in everything what is necessary?

Validation rules can be made conditional...

Alex

Michael Küng June 15, 2021

Hi Alex,

How can I use the validation rules for a checkbox group field to allow only 3 selections? I have tried it within

I have tried it with a confiForm rules for field definition

Condition - FIELDNAME.asCount:>3

Action to execute: Validation rule

Validation rule: FIELDNAME.asCount:>3

 

I am think I am on the wrong way? :D Don't get it running....also not if I use the validation rule within the confiform field definition.

Regards,

Michael

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 15, 2021

You need to put an error message / message to show when validation is failed.

Do you have that set?

Validation rule can be left empty - important is the "condition" - in other words, you describe when there is an error condition (on form submit) and you report that

Michael Küng June 15, 2021

Uhh it was that easy! ;)

It works if I remove the validation rule!

Thank you!

0 votes
Erik Buchholz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2020

You can make the necessary field required if there is no condition. If you have conditions like "we need this field if that field" use the validation rules @Alex Medved _ConfiForms_ mentioned.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
6.15.9
TAGS
AUG Leaders

Atlassian Community Events