All conditional fied tags appear in email
-
Hello,
we have an issue where all field tags are being displayed in the email, even thought “Exclude lines with blank mail-tags from output” is checked.
Use case:
I have 2 radio buttons that are being displayed, each shows different select dropdown element with its own option elements depending on which radio button is currently selected.
So if I select “Radio 1”, “Select 1” is being displayed, if I select “Radio 2” then “Select 2 is being displayed”.
Now if I have Radio 1 selected and Select 1 is being displayed, I choose an option from Select 1, then leave it at that, switch to Radio 2 to show Select 2 and select an option from it, also leave at that.
Then I send the form, and both values from both Select 1 and 2 are being displayed next to each other.Conditional tags export:
if [radio-543] equals "Radio 1" then show [selgroup1] if [radio-543] equals "Radio 2" then show [selgroup2]
Form code:
<div class="row"> <div class="col-xs-12 form-title"> Registration </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6"> <p>[text* your-name placeholder "Your Name"]</p> </div> <div class="col-xs-12 col-sm-6"> <p>[text* your-surename placeholder "Your surename"]</p> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6"> <p>[tel* tel-857 placeholder "Your phone"]</p> </div> <div class="col-xs-12 col-sm-6"> <p>[email* your-email placeholder "Your email"]</p> </div> </div> <div class="row"> <div class="col-xs-12"> <p>[date* date-71 id:regData date-format:Y-m-d min-date:1 max-date:+1Y first-day:1 change-month change-year placeholder "Choose date"]</p> </div> </div> <fieldset> <div class="row"> <div class="col-xs-12"> [radio radio-543 id:regPasirinkimas2 use_label_element default:1 "Radio 1" "Radio 2"] [group selgroup1][select* menu-551 id:selectDropdown1 class:cs-select class:cs-skin-boxes first_as_label "Select 1" "S1 Option 1" "S1 Option 2" "S1 Option 3" "S1 Option 4"][/group][group selgroup2][select* menu-552 id:selectDropdown2 class:cs-select class:cs-skin-boxes first_as_label "Select 2" "optgroup-Group1" "S2G1 Option 1" "S2G1 Option 2" "S2G1 Option 3" "S2G1 Option 4" "endoptgroup" "optgroup-Group2" "S2G2 Option 1" "S2G2 Option 2" "S2G2 Option 3" "endoptgroup" "optgroup-Group3" "S2G3 Option 1" "S2G3 Option 2" "S2G3 Option 3" "endoptgroup"][/group]</div> </div> </fieldset> <div class="row"> <div class="col-xs-12"> <p>[textarea textarea-93 placeholder "Papildomi komentarai (galite nurodyti problem? ar u?duoti klausim?)"]</p> </div> </div> <div class="row"> <div class="col-xs-12"> <p>[submit "Register"]</p> </div> </div>
Other plugins I use for the form:
Contact Form 7 Datepicker
Contact Form 7 HoneypotOther scripts I use for the form:
Script to form Option Groups in Select (should not affect your plugin):
$(function(){ var foundin = $('#selectDropdown2 option:contains("optgroup-")'); $.each(foundin, function(value){ var updated = $(this).val().replace('optgroup-',''); $(this).nextUntil('option:contains("endoptgroup")').wrapAll('<optgroup label="'+updated+'"></optgroup>'); }); $('#selectDropdown2 option:contains("optgroup-")').remove(); $('#selectDropdown2 option:contains("endoptgroup")').remove(); });
Script to modify datepicker (should also not affect your plugin):
jQuery(function($){ var holidayDates = []; $("#regData").datepicker({ numberOfMonths: 1, beforeShowDay: function(date) { var day = date.getDay(), dm = date.getDate() + "-" + (date.getMonth() + 1); var isHoliday = ($.inArray(dm, holidayDates) != -1); return [day != 0 && !isHoliday]; }}); });
Overall, I checked your plugin JS file, and you seem to have tested few cases with text inputs, selects and checkboxes, but didn’t find radio buttons, maybe that may be the case?
I would expect that selecting checkbox/radio button element would clear conditional elements’ value (or an option to do so) or somehow else wouldn’t display conditionally hidden fields’ value.
- The topic ‘All conditional fied tags appear in email’ is closed to new replies.