Can't See a New Form Under "Submit a Request"

Answered

3 Comments

  • Damon Maranya

    I tried converting the JQuerry to JScript using ChatGPT (sure it hallucinates, but it's a pretty good code monkey). Just on the off chance that it's a library thing. But the behavior remains the same.

    I can't figure out why the IF block that worked for the original code and is working in the new code with the additional organization. Isn't working for the second form.

    I ran the Form A old IF block and the new Form B IF block through text comparison and the only things that are different are the organization name and the form ID.

    But they should be different and shouldn't affect how the code runs. As long as the form number and organization names are correct, which they are. I copied and pasted the form ID for the new form out of the URL of the Form B edit page, just to make sure that it was correct.

    I even ran the end of the URL and the form ID from the code through a text compare just to make sure I wasn't wearing my crazy pants by accident or something.

    Does anyone have any idea why these two code blocks are behaving differently?

    The new JScript version of the code if anyone is interested.

    var i = 0;
    var checkExist = setInterval(function() {
      i++;
      var elements = document.querySelectorAll("a.nesty-input");
      if (elements.length) {
        clearInterval(checkExist);
        Array.prototype.forEach.call(elements, function(element) {
          element.addEventListener('click', function() {
            for (var c in HelpCenter.user.organizations) {
              if (HelpCenter.user.organizations[c].name === "Managers" || HelpCenter.user.organizations[c].name === "HR") {
                document.getElementById("360003482932").style.display = 'block';
              } else {
                document.getElementById("360003482932").style.display = 'none';
              }

              if (HelpCenter.user.organizations[c].name === "HR"){
                document.getElementById("14992348743700").style.display = 'block';
              } else {
                document.getElementById("14992348743700").style.display = 'none';
              }
            }
          });
        });
      }
    }, 100); //assuming the interval is 100 milliseconds
    0
  • Damon Maranya

    Well, I just tried it one more time. But this time I refreshed all of the open Zendesk pages, and now it's working in preview.

    I have no idea why it wasn't working before. But I feel like there's an old saying about gifts and horses' mouths that applies here.

    0
  • Brett Bowser
    Zendesk Community Manager

    Glad you were able to get this resolved Damon! Appreciate you sharing your solution with everyone :) 

    0

Please sign in to leave a comment.

Powered by Zendesk