Oskabaar
-
Posts
8 -
Joined
-
Last visited
Reputation Activity
-
Oskabaar reacted to nyunyiboy in Hide and disable Delete and Submit button based on condition
Hi @Oskabaar,
In response to your question about the form, if you want a field to become visible only after the previous field is answered, you can achieve this by adding a rule. More detailed information can be found here:
Additionally, to hide the submit button until the last field or question is answered, you can also add a conditional rule and CSS to accomplish this. You may check this for reference:
I hope that helps!
-
Oskabaar got a reaction from CoopperBackpack in Hide and disable Delete and Submit button based on condition
Hello CooperBackpack, Yes it works, thanks a lot!
Kind regards, Elke
-
Oskabaar reacted to CoopperBackpack in Hide and disable Delete and Submit button based on condition
Hello @Oskabaar,
Elements on Single Record Update have their own classes and IDs.
Please test this version:
<script> document.addEventListener('DataPageReady', hideUpdateBtn); function hideUpdateBtn() { const lastQuestion = document.querySelector('#EditRecordField_name'); //Field_name should be replaced by your field name const updateBtn = document.querySelector('form[action*="[@cbAppKey]"] div.cbUpdateButtonContainer'); updateBtn.style.display = 'none'; lastQuestion.addEventListener('change', (event) =>{ let selectedValue = event.target.value; if(selectedValue !== ''){ updateBtn.style.display = 'block'; } else{ updateBtn.style.display = 'none'; } }) } </script> -
Oskabaar reacted to FinTheHuman in Only 1 question to be visible at a time
Here are some similar forum posts that you can refer to as well:
-
Oskabaar reacted to FinTheHuman in Only 1 question to be visible at a time
There is a custom solution that allows you to have a collapsible section for your form to hide/unhide them. Check this tutorial:
-
Oskabaar reacted to FinTheHuman in Only 1 question to be visible at a time
Hello @Oskabaar,
What I can suggest is for you to use a conditional form(Rules), you can create 21 sections per question and use the rules to hide/unhide the other questions if they are unanswered yet. For more details check this out:
https://howto.caspio.com/datapages/forms/conditional-forms/
-
Oskabaar reacted to CoopperBackpack in Hide and disable Delete and Submit button based on condition
Hello @Oskabaar,
As far as I understand you applied Rules to hide the fields.
I don`t know how the fields are set up (if they are Radio Buttons, Dropdowns, etc.), however, please test this code in the Footer. Don`t forget to disable the HTML editor on the Advanced tab before adding the code.
Also, please use your field name of the last question in the code.
<script> document.addEventListener('DataPageReady', hideSubmitBtn); function hideSubmitBtn() { const lastQuestion = document.querySelector('#InsertRecordField_name'); //Field_name should be replaced by your field name const submitBtn = document.querySelector('form[action*="[@cbAppKey]"] div.cbSubmitButtonContainer'); submitBtn.style.display = 'none'; lastQuestion.addEventListener('change', (event) =>{ let selectedValue = event.target.value; if(selectedValue !== ''){ submitBtn.style.display = 'block'; } else{ submitBtn.style.display = 'none'; } }) } </script>