Field Visibility logic being ignored by browser
-
I have made the display of three text fields conditional on the value of a number field.
Field one is supposed to display when number field is greater than 0.
Field two is supposed to display when number field is greater than 1.
Field three is supposed to display when number field is greater than 2.
Number field has max value of 3. Default is 0.
I have used this logic before on many other forms. However, this time it does not work, and all three fields display regardless of the value in the number field.
This is on a site about to go into production, so anyone who could grab this quickly, I would appreciate it!!
Website is currently behind an under construction page, so please email me for the access code.
-
I hope you can get in touch soon.
-
This reply was modified 2 years, 2 months ago by
diorosaecrucis.
Hi @diorosaecrucis,
Sorry to know that you are experiencing this issue.
Can you please share an export of the form so we could give a closer look at the issue? Please share the export using pastebin.com or Google Drive.
I hope the following documentation comes in handy: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export
We look forward to hearing back from you.
Kind Regards,
Nebu John{"type":"form","data":{"fields":[{"id":"name-1","element_id":"name-1","form_id":"wrapper-4655-3475","parent_group":"","type":"name","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-4655-3475","field_label":"Name","placeholder":"E.g. John Doe","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix":"","fname":"true","mname":"","lname":"true","required_message":"Name is required.","prefix_required_message":"Prefix is required.","fname_required_message":"First Name is required.","mname_required_message":"Middle Name is required.","lname_required_message":"Last Name is required.","required":"1","multiple_name":"true","fname_required":"1","lname_required":"1"},{"id":"email-1","element_id":"email-1","form_id":"wrapper-2642-7806","parent_group":"","type":"email","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-2642-7806","validation":"1","placeholder":"E.g. john@doe.com","field_label":"Email Address","required":"1","validation_message":"Please check for a valid email format","required_message":"Please enter a valid email address"},{"id":"url-1","element_id":"url-1","form_id":"wrapper-5522-9586","parent_group":"","type":"url","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-5522-9586","field_label":"Company Name:","placeholder":"","required":"1"},{"id":"url-2","element_id":"url-2","form_id":"wrapper-5522-9586","parent_group":"","type":"url","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-5522-9586","field_label":"Website:","placeholder":"E.g. http:\/\/www.yourdomainname.com","description":"If you have a website, please enter it here"},{"id":"address-1","element_id":"address-1","form_id":"wrapper-6100-5305","parent_group":"","type":"address","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-6100-5305","street_address":"true","address_city":"true","address_state":"true","address_zip":"true","address_country":"true","address_line":"true","street_address_label":"Street Address","street_address_placeholder":"E.g. 42 Wallaby Way","address_city_label":"City","address_city_placeholder":"E.g. Sydney","address_state_label":"State\/Province","address_state_placeholder":"E.g. New South Wales","address_zip_label":"ZIP \/ Postal Code","address_zip_placeholder":"E.g. 2000","address_country_label":"Country","address_line_label":"Apartment, suite, etc","street_address_required_message":"This field is required. Please enter the street address.","address_zip_required_message":"This field is required. Please enter the zip code.","address_country_required_message":"This field is required to be able to process your payment. Please select the country.","address_city_required_message":"This field is required. Please enter the city.","address_state_required_message":"This field is required. Please enter the state.","address_line_required_message":"This field is required. Please enter address line.","street_address_required":"1","address_city_required":"1","address_state_required":"1","address_zip_required":"1","address_country_required":"1"},{"id":"phone-1","element_id":"phone-1","form_id":"wrapper-1207-6972","parent_group":"","type":"phone","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-1207-6972","required":"1","limit":"10","limit_type":"characters","validation":"none","field_label":"Phone","placeholder":"E.g. +1 300 400 5000","description":"Best number to get hold of you if necessary, please."},{"id":"number-1","element_id":"number-1","form_id":"wrapper-9902-7720","parent_group":"","type":"number","options":[],"cols":"4","conditions":[],"wrapper_id":"wrapper-9902-7720","calculations":"true","limit_min":"0","limit_max":"3","field_label":"Number of Additional People needed to run your booth:","placeholder":"","description":"How many people will be helping you at the Symposium? (max of 3 people in addition to yourself)","required":"","prefill":"","precision":"0","default_value":"0"},{"id":"html-1","element_id":"html-1","form_id":"wrapper-9902-7720","parent_group":"","type":"html","options":[],"cols":"4","conditions":[],"wrapper_id":"wrapper-9902-7720","field_label":""},{"id":"html-2","element_id":"html-2","form_id":"wrapper-9902-7720","parent_group":"","type":"html","options":[],"cols":"4","conditions":[],"wrapper_id":"wrapper-9902-7720","field_label":"","formid":"wrapper-1214-2531"},{"id":"name-2","element_id":"name-2","form_id":"wrapper-2999-3589","parent_group":"","type":"name","options":[],"cols":"12","conditions":[{"element_id":"number-1","rule":"is_great","value":"0"}],"wrapper_id":"wrapper-2999-3589","field_label":"Helper 1 Full Name:","placeholder":"E.g. John Doe","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix":"true","fname":"true","mname":"true","lname":"true","required_message":"Full Name for Helper 1 is required.","prefix_required_message":"Prefix is required.","fname_required_message":"First Name is required.","mname_required_message":"Middle Name is required.","lname_required_message":"Last Name is required.","required":"1","condition_action":"show","condition_rule":"any"},{"id":"name-3","element_id":"name-3","form_id":"wrapper-8736-9113","parent_group":"","type":"name","options":[],"cols":"12","conditions":[{"element_id":"number-1","rule":"is_great","value":"1"}],"wrapper_id":"wrapper-8736-9113","field_label":"Helper 2 Full Name:","placeholder":"E.g. John Doe","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix":"true","fname":"true","mname":"true","lname":"true","required_message":"Full Name for Helper 2 is required.","prefix_required_message":"Prefix is required.","fname_required_message":"First Name is required.","mname_required_message":"Middle Name is required.","lname_required_message":"Last Name is required.","required":"1","formid":"wrapper-8736-9113","condition_rule":"any"},{"id":"name-4","element_id":"name-4","form_id":"wrapper-4924-2718","parent_group":"","type":"name","options":[],"cols":"12","conditions":[{"element_id":"number-1","rule":"is_great","value":"2"}],"wrapper_id":"wrapper-4924-2718","field_label":"Helper 3 Full Name:","placeholder":"E.g. John Doe","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix":"true","fname":"true","mname":"true","lname":"true","required_message":"Full Name for Helper 3 is required.","prefix_required_message":"Prefix is required.","fname_required_message":"First Name is required.","mname_required_message":"Middle Name is required.","lname_required_message":"Last Name is required.","required":"1","formid":"wrapper-4924-2718","condition_action":"show","condition_rule":"any"},{"id":"page-break-1","element_id":"page-break-1","form_id":"wrapper-1461-2645","parent_group":"","type":"page-break","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-1461-2645","btn_left":"\u00ab Previous Step","btn_right":"Next Step \u00bb"},{"id":"text-1","element_id":"text-1","form_id":"wrapper-1586-6469","parent_group":"","type":"text","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-1586-6469","input_type":"line","limit_type":"characters","field_label":"Main Product:","placeholder":"E.g. Posters\/Artwork\/Books","description":"This will be your premier product type","required":"1"},{"id":"textarea-1","element_id":"textarea-1","form_id":"wrapper-3536-2879","parent_group":"","type":"textarea","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-3536-2879","input_type":"line","limit_type":"characters","field_label":"Supporting Products:","placeholder":"E.g. knicknacks, supporting items, lower priced items","description":"If you plan on selling more than one type of item, please list them all here, separated by commas"},{"id":"page-break-2","element_id":"page-break-2","form_id":"wrapper-2524-9997","parent_group":"","type":"page-break","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-2524-9997","btn_left":"\u00ab Previous Step","btn_right":"Next Step \u00bb","formid":"wrapper-4746-7148"},{"id":"number-2","element_id":"number-2","form_id":"wrapper-1297-4865","parent_group":"","type":"number","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-1297-4865","calculations":"true","limit_min":"1","limit_max":"10","field_label":"Number of Tables Needed:","placeholder":"E.g. 1, 2, 3","default_value":"1","description":"Tables are 300 each for the entire weekend, Tables are 6 feet long (unless otherwise specified) and come with a tablecloth and 2 chairs.","required":"1","precision":"0"},{"id":"calculation-1","element_id":"calculation-1","form_id":"wrapper-1297-4865","parent_group":"","type":"calculation","options":[],"cols":"6","conditions":[],"wrapper_id":"wrapper-1297-4865","field_label":"Total Price:","prefix":"$","formula":"{number-2}*300"},{"id":"paypal-1","element_id":"paypal-1","form_id":"wrapper-4409-4455","parent_group":"","type":"paypal","options":[],"cols":"12","conditions":[],"wrapper_id":"wrapper-4409-4455","mode":"live","currency":"USD","amount_type":"variable","label":"pay","color":"gold","shape":"pill","layout":"horizontal","tagline":"false","locale":"en_US","debug_mode":"disable","height":"50","variable":"calculation-1","billing-details":"true","billing-name":"name-1","billing-email":"email-1","billing-address":"address-1","width":"200"}],"settings":{"pagination-header":"nav","paginationData":{"pagination-header-design":"show","pagination-header":"nav","page-break-1-steps":"Your Info:","page-break-2-steps":"What will you be selling:","last-steps":"Payment"},"formName":"Vendor Form","version":"1.22.1","form-border-style":"none","form-padding":"","form-border":"","fields-style":"open","validation":"on_submit","akismet-protection":"0","form-style":"default","enable-ajax":"true","autoclose":"true","submission-indicator":"show","indicator-label":"Submitting...","form-type":"default","submission-behaviour":"behaviour-hide","thankyou-message":"Thank you for contacting us, we will be in touch shortly.","submitData":{"custom-submit-text":"Send Message","custom-invalid-form-message":"Error: Your form is not valid, please fix the errors!"},"validation-inline":"1","form-expire":"no_expire","form-padding-top":"0","form-padding-right":"0","form-padding-bottom":"0","form-padding-left":"0","form-border-width":"0","form-border-radius":"0","cform-label-font-family":"Roboto","cform-label-custom-family":"","cform-label-font-size":"12","cform-label-font-weight":"bold","cform-title-font-family":"Roboto","cform-title-custom-family":"","cform-title-font-size":"45","cform-title-font-weight":"normal","cform-title-text-align":"left","cform-subtitle-font-family":"Roboto","cform-subtitle-custom-font":"","cform-subtitle-font-size":"18","cform-subtitle-font-weight":"normal","cform-subtitle-text-align":"left","cform-input-font-family":"Roboto","cform-input-custom-font":"","cform-input-font-size":"16","cform-input-font-weight":"normal","cform-radio-font-family":"Roboto","cform-radio-custom-font":"","cform-radio-font-size":"14","cform-radio-font-weight":"normal","cform-select-font-family":"Roboto","cform-select-custom-family":"","cform-select-font-size":"16","cform-select-font-weight":"normal","cform-multiselect-font-family":"Roboto","cform-multiselect-custom-font":"","cform-multiselect-font-size":"16","cform-multiselect-font-weight":"normal","cform-dropdown-font-family":"Roboto","cform-dropdown-custom-font":"","cform-dropdown-font-size":"16","cform-dropdown-font-weight":"normal","cform-calendar-font-family":"Roboto","cform-calendar-custom-font":"","cform-calendar-font-size":"13","cform-calendar-font-weight":"normal","cform-button-font-family":"Roboto","cform-button-custom-font":"","cform-button-font-size":"14","cform-button-font-weight":"500","cform-timeline-font-family":"Roboto","cform-timeline-custom-font":"","cform-timeline-font-size":"12","cform-timeline-font-weight":"normal","cform-pagination-font-family":"","cform-pagination-custom-font":"","cform-pagination-font-size":"16","cform-pagination-font-weight":"normal","payment_require_ssl":"","submission-file":"delete","store_submissions":"1","form_name":"vendor-form","form_status":"publish","sc_email_link":"1","sc_message":"<p>Your form has been saved as draft and a resume link has been generated so you can return to the form anytime within {retention_period} days from today. Copy and save the link or enter your email address below to have the link sent to your mail.<\/p><p>These fields weren't saved to your submission draft: Paypal, Stripe, Signature, Password, Captcha, and Upload. Kindly fill them out before submitting the form.<\/p>","honeypot":"1","use_ajax_load":"1","use_donotcachepage":"1"},"client_id":null,"integration_conditions":[],"behaviors":[{"slug":"behavior-1234-4567","label":"","autoclose-time":"10","autoclose":"true","newtab":"sametab","thankyou-message":"<p style=\"text-align: center\">Thank you for registering!\u00a0 We will be in touch if we have any questions.<\/p>","email-thankyou-message":"","manual-thankyou-message":"","submission-behaviour":"behaviour-hide","redirect-url":""}],"notifications":[{"slug":"notification-1234-4567","label":"Symposium Vendor Email Submitted to","email-recipients":"default","recipients":"symposium@mufon.com, hq@mufon.com, tgrfan082367@gmail.com","email-subject":"Symposium Vendor Application #{submission_id} for {form_name}","email-editor":"You have a new website form submission: <br \/> {all_fields} <br \/>---<br \/> This message was sent from {site_url}.","email-attachment":"true","type":"default","conditions":[],"routing":[],"from-name":"2023 Symposium Vendor Application","form-email":"symposium@mufon.com","replyto-email":"symposium@mufon.com","cc-email":"","bcc-email":""}]},"status":"publish","version":"1.22.1"}
I tested your form in my lab and all seems to work fine. Please follow both recommendations:
- Please deactivate all plugins except this one and check if the problem is gone. If so, then enable all plugins one by one and find which one is having a conflict. If there is no positive result, switch to the default WordPress theme like 2019, and see if it works. Before this test, we recommend full site backup or running this test on the staging site.
- If above test will give no positive results, please share in possible your page URL where form is located so we could check are there any errors in the browser console.
Kind Regards,
KrisPlease use the following before Feb 1st:
https://mufonsymposium.com/letmec (behind a coming soon page)
Click the Vendors menu item.
Hi @diorosaecrucis,
I found a javascript error while investigating the issue. Can you confirm if you have done a thorough conflict test?
Kind Regards,
Nebu JohnIf there is a javascript error, then why does the same logic work when you use the form that is under the menu item Register -> Press Registration when you add a “helper” at the bottom of the page.? Seems more like an issue with your paypal integration. The only real difference between those two pages is using the paypal button.
And yes, I went to theme 2022, plugins deactivated, and still had same error. Is it because the additional name fields are required? That logic should still be conditional on if the element is visible or not. Or is that an incorrect assumption?
I hope you’re well today!
The PayPal button makes a difference here because due to the presence of the PayPal button on the form, the form is attempting to load PayPal SDK scripts and, according to the error, there’s already another instance of it loaded, in a different (older version).
Additionally, the site apparently uses our Hummingbird to perform Asset Optimization. While that’s a good thing performance-wise, it also means that some scripts would be combined (so instead of each script on site being loaded separately, some of them are combined into “multiple scripts in single file”) which may cause additional issues if one of such combined scripts fails.
The visibility logic makes heavy use of JS and that’s why, even if it may seem a bit strange, it may sometimes fall under such seemingly unrelated conflicts.
————
All that suggest that there either is or was (but is somehow cached, e.g. in optimized assets) another version of PayPal JS SDK library loaded on site and that creates the conflict.
I understand you did plugin conflict but still, there’s a chance that even then JS was cached either server-side or just in browser (JS is often cached in browser) so I would suggest following steps:
1. review your plugins and theme options and see if there is any single plugin other than Forminator that does have any “PayPal buttons” related option – and try disabling either that option or that plugin if there is any; even if there isn’t any, do also apply step 2 below
2. temporarily disable Asset Optimization in Hummingbird and then clear all cache entirely: a) go to “Hummingbird -> Dashboard” page and use “Clear cache” button there b) then if there’s any other caching plugin on site also clear that cache c) and clear any server-side cache there is too
Then test the form in browser’s “incognito” window. If it works, test it again in regular browser tab but make sure to “hard reload” the page at least a few times or, better yet, clear browser cache.
Let us know about results, please.
Kind regards,
AdamHello @diorosaecrucis ,
We haven’t heard from you for some time now, so it looks like you don’t have more questions for us.
Feel free to re-open this ticket if needed.
Kind regards
Kasia -
This reply was modified 2 years, 2 months ago by
- The topic ‘Field Visibility logic being ignored by browser’ is closed to new replies.