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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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.

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

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

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

Uhh it was that easy! ;)

It works if I remove the validation rule!

Thank you!

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
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,443 views 7 29
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you