Victor,
Thank you for your insight. Filter is an unfortunate choice of words by Formidable because it does confuse the matter with the WordPress API. Nevertheless, their "Look-up" fields provide a way pre-fill values based upon a previously filled field. In our case our first look-up field provides a list of schools with "high-school" as a defining moment. The list of high schools produces students. The form works really well at delineating the students, complete with checkboxes that the Javascript code will count.
However, we don't want to show all 300 + students. Therefore, we use another lookup filter to whittle them down to the students under the supervision of a selected coach. They then appear in a list of checkboxes.
When we had all 300 student checboxes visible, the Javascript would count the number of boxes the user checked.
When we apply the last filter, the counter stops working. The console does not show an error.
I would be willing hide a field to keep up with the count, but I hate not knowing why the code just quit.
It sounds like you might be running into an Ajax issue. Ajax is complicated and difficult to troubleshoot. If the lookup fields are cascading correctly and they are using Ajax to populate the drop downs, it's likely that the data in the final dropdown field is not being recognized by the Document Object Model (DOM). The DOM is constructed when the page is loaded. For any jQuery snippet that interacts with form data, all the form data it interacts with needs to be loaded when the page is initialized otherwise the jQuery fails to "see" new data added through Ajax. If that's the case, jQuery needs to reinitialized when the Ajax.complete() event fires. I don't know for certain if this is what's happening in your case, but from the symptoms you describe, it sounds like it. You may want to take a look at this article to get an in depth look at what I'm talking about: https://formidable-masterminds.com/repeaters-and-complex-jquery-operations/
Please login or Register to submit your answer