Score:2

Disable submissions basing on a form element value/selection

ca flag

I know I can turn submissions being saved in the database either on or off completely.

Is there a way I can avoid the submission is saved basing on the value selected for a form element, for example a Yes/No radio button?

Score:3
us flag

You can use a WebformSettingsHandler to conditionally disable the saving of results.

enter image description here

Atam Dhillon avatar
ca flag
Hi Jacob, Thanks heaps for this. However, when I implement this, though the submissions are not appearing in the results view, but the count seems to be affected. The next submission (that should be saved) does have the serial number jumped by the numbers of submissions not saved as well. So, if last submission is No. 19, I then tested two submissions that should not have been saved, then I submitted one that should be saved but it appears with No. 22 in the view rather than the 20th submission. Is this also fixable, otherwise it can create confusion for proper order count. Please advise.
us flag
I can confirm that the serial incrementing is an unexpected behavior. Feel free to create a ticket in the webform module's issue queue. This might be something we can't fix because people might be relying on this behavior. Still, it would be possible to provide a simple patch.
Atam Dhillon avatar
ca flag
Thanks Jacob. I shall.
Atam Dhillon avatar
ca flag
Raised - https://www.drupal.org/project/webform/issues/3259055#comment-14377068.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.