BUG: popup web forms

Hello

This has been plaguing me, and I didn't realize what the issue was until another report came.

This all happened after upgrading to B1.

Any form control that requires javascript to interact fails when loaded though UNA ajax (processjson).

It started when a few custom headers I was using quit working. Then it went to some other form elements. (All loaded via ajax and popuped up using una core popup functions).

I realized it wasn't me when a custom mod made by ABQ stopped working as well. It has a simple 'switcher' for a rate agreement. The switch wouldn't toggle.

I had no JavaScript errors on my page. And if I add the content into the document inline (display:none) than .dolPopup the element, form items work again.

Something is not getting initialized for form elements when loaded through ajax.

  • 474
  • More
Replies (13)
    • @Anton L can you please take a look at this?

      • I was so busy working on so many different things, I didn't catch this. It definitely happened upgrading to B1.

        Which introduced htmx. I do not have it on, because you haven't finished fixing any of it... However, I think something broke with popup forms and controls that rely on JavaScript.

        Switchers, don't work. They don't activate and remain in off state, pressing them does nothing.

        Headers quit opening and closing

        Rgb/rgba controllers don't work

        Again, this is only when loading any type of form element ajaxy.

        • I tried adding $('#id-of-popup').processWebForms() and it did nothing. 👀

          • Hello. UNA uses forms in popups many times. For example, action forms in grids. I just checked some of them on our dev site with clean installation (https://ci.una.io/test/) and they are working fine. So, if you provide me with a detailed description of how the issue can be reproduced I'll investigate the problem.

            • Anytime a JavaScript control is used. Switcher is the easiest to check.

              Can you give me a place where UNA uses a JavaScript control in popup? I'll test.

              • Let me reexplain. Forms work in popups. JavaScript submitting works. It loads, displays, etc. So inputs or selects, even checkmarks work without issue.

                JavaScript controlled inputs do not. So headers (stop expanding and collapsing) and switchers wont switch. This happens when the form is loaded dynamically through ajax.

                I have done extensive testing, and I am getting 0 JavaScript errors on the page. It simply isn't initialized properly so the controls don't work.

                @Anton L I hope I explained better 🙏

                • Can you give me a place where UNA uses a JavaScript control in popup? I'll test.

                  For example, Client field (profile auto-suggestion field with JS dynamic loading) in Manual Orders form in popup. You may test it in Orders grid (Account popup -> Dashboard -> Orders).

                  • I understood what you're saying but it looks like you have some unique case. For example, if you try to use 'Add new...' block, which loads forms dynamically, and load 'Poll' form, you should see that JS based fields like 'Answers' and 'Anonymous vote' (switcher) are working.

                    Note, I'm saying about clean (non-modified) version of UNA.

                    • That does not look like it is in a popup.

                      Now I'm going to install a clean version on a dev sub, just to test, because my site is heavily modified, however, no core changes and no JavaScript errors. When I first noticed this issue, I disabled half my site trying to track it to an added mod, but didn't find any.

                      I'm going to backup my site, and disable everything but core apps. One by one, checking popup form.

                      • That does not look like it is in a popup.

                        Yes, it's not a popup but "the form is loaded dynamically through ajax" and has necessary elements as you described:

                        JavaScript controlled inputs do not. So headers (stop expanding and collapsing) and switchers wont switch. This happens when the form is loaded dynamically through ajax.

                        May I see and test the popup you're saying about?

                        • Ok, I readded the create post block. Polls load, but switchers do not switch. They show just like above, but clicking them does nothing.

                          So for me, they don't work.

                          Now I'm about to go on a witch hunt. I will spend a day disabling everything. I'm also upgrading to B2 tonight as well.

                          • @Anton L first and foremost, thank you very much for taking your time and testing. I am grateful you took the time, and I apologize for not doing my due diligence and removing mods.

                            I found what was causing the problem, but can't figure out why. No JavaScript errors at all.

                            Again, I apologize for wasting your time, I pride myself in making sure what I report is accurate.

                            • Hello @Wise Don't worry. You've already reported a lot of real/critical issues. So, it's not a problem if one of them wasn't a core issue.

                              I found what was causing the problem, but can't figure out why. No JavaScript errors at all.

                              I had deal with similar situations. In my case JS code, which is attached to the results of dynamically loaded content as text, had an error. But it wasn't shown in console. I suppose because of it was attached as text.

                              It's great that you've found the problem!

                              Login or Join to comment.