clear_on_hide
works for all form groups that are hidden. However, I now need to remove an option. I can disable the second option via JS, but I would rather remove that option altogether and use a text field to indicate there is only that one option available, and there’s no need for a dropdown when there are no choices. So, I tried replacing the dropdown with
Unfortunately, when CF7 sends emails, it is including the label for that field as well as the text of the field in all hidden repeating groups, despite “Exclude lines with blank mail-tags from output” being checked.
In order for a dropdown to clear_on_hide
, a first_as_label
such as “- Select -” must be used, and it looks silly to do it this way when there’s only a single option available in the dropdown (and it looks ridiculous to use a dropdown to begin with when there are no choices). This is why I want to just use a text field.
I can’t simply delete the text field from the CF7 mail output, because the user needs to be shown this [now forced] option in their email for every section that they actually fill out (non-hidden). Also, removal of the second option is temporary; it will be removed/replaced at specific intervals, so the less editing I need to do, the better.
Am I missing something or is clear_on_hide
a readonly text field and then refill the text field with the CF7 tag value upon showing the group not supported with your plugin (yet)? If not, then consider this a feature request.
My field boxes are sized, positioned and aligned with the Column Shortcodes plugin, so that all fields match and look right. Checkboxes or radios would adversely affect the aesthetics, for one thing, so I’m stuck with using dropdown or text field.
I appreciate the speed with which you have responded to this feature request.
Unfortunately, it isn’t clearing fields within the groups that are being hidden. Upon unhiding, the data is still there.
Also, user-toggled hidden groups should not be validated when hidden, which your plugin is currently doing.
So, for example, when a user fills out fields in a group and then changes their mind and decides to remove/hide that section, all of that group’s data should clear, which, of course, also means there should be no validation performed on the cleared fields, since the user intended to leave them empty.
]]>Any idea how to debug this for my case?
Thanks
]]>I’ve a form with get parameters that is redirected from a site with my products. After a client click on a button on a product site he gets the choice automatically in the form with 3 selected kinds of products.
When a client want to unclick some products like in this example “Tor(e)” and “Pforte” and want to buy only “Zaun” so the values for “Tor(e)” and “Pforte” are remembered and appearing in the email. If you unclick this 2 and click you can see the values are still there.
The checkbox field is defined as: [checkbox* anlage default:post_meta default:get “Zaun” “Tor(e)” “Pforte” “Gel?nder”]
I’ve tried to hide it with “clear_on_hide” but it didn’t worked. Is there any possibility to clear the values there?
Best regards
So, after to clear the input field, the user will see an empty field which cannot be filled.
May be if existed an exception of clear_on_hide like “not_clear_on_hide” or:
can be more easy than create a lot of nested groups.
Thanks for this great plugin addon.
]]>I was playing around with your code, and I added a console.log($group.attr('id'));
to get the id of the group it was being called on, and added a console.log($inputs);
, and figured out that it was activating the if ($group.attr('data-clear_on_hide') !== undefined) {
after the group was being hidden, so .not(':button, :submit, :reset, :hidden')
will never find the inputs in the group because they’re already hidden. So either you need to move that function before you hide the inputs in the group, or change the code to .not(':button, :submit, :reset')
. After the change, then everything clears correctly.
Also, you could also change if ($group.attr('data-clear_on_hide') !== undefined)
to if ($group.data('clear_on_hide') !== undefined)
, but that doesn’t change the functionality of the code.
I’ve got it all set up to work correctly but unfortunately clear_on_hide doesn’t seem to be working at all, so if someone goes to add extra players and accidentally clicks on one of the programs before closing it, the price gets added to their total even after hiding.
It doesn’t matter if nothing else gets cleared, but I really need to be able to at least clear any of the checkboxes in some specific divs. I’ve tried several workarounds but nothing seems to be doing the trick, it’s sending emails correctly, but I have a hidden paypal button that is triggered on submit and it’s picking up the wrong totals.
Help!
]]>My issue is as follows –
As a user, I fill out some conditional field
Then I change my selection which hides the conditional field
I submit my form
As the recipient of the email, I still see the fields being captured, even though the user changed their mind – making it difficult to read.
I would like to either not include the collapsed fields in the email response OR clear the previous selections on hide (in which case they would be empty fields and not appear in the email – theoretically)
In the link above, I am testing the bottom bit
Form code looks like this
<label> Please select</label> [radio TEST-CONDITION default:1 "YES" "NO"]
[group GROUP-TEST clear_on_hide]
<LABEL>TEST THE TEXT: </LABEL>[/group]
Condition is:
show GROUP-TEST if TEST-CONDITION equals NO
In the mail tab:
<strong>TEST radio:</strong> [TEST-CONDITION]
<strong>TEST THE TEXT:</strong> [TEST-TEXT]
Can you please help?
Thanks!
What’s the problem?
Can you help me?