Hiding a Form From All Users Except Member of an Organization

36 Kommentare

  • Ruddy DEROSIERS

    John DiGregorio

    Have you inserted the script in your document.head ?

    also

    0
  • John DiGregorio

    Thanks I will give this a try later today

     

    0
  • Noelle Cheng

    Hi I'm confused. This isn't working for me either and mtrl.bike's explanation is not clear for me. Where do we put Kay's code?

     

    I used Ruddy DEROSIERS code. This is what I have now. Can someone help?? :( 

    This is the current version I'm on.

     

    For each section (in BOLD) I put the following:

    SCRIPT.JS section

      //Hide Form
      var i = 0;
         var checkExist = setInterval(function() {
         i++;
         if ($("a.nesty-input").length){
         clearInterval(checkExist);
         $("a.nesty-input").each(function() {
         $(this).bind( "click", function() {
         for (var c in HelpCenter.user.organizations) {
         if (HelpCenter.user.organizations[c].name ==="Main Company"){
         $("#7286425102107").show();
         } 

    else {

    $("#7286425102107").hide();

    }
         
         //reserve space for additional organizations 
         }
         
         });
         });
         }
         if (i > 10){
         clearInterval(checkExist);
         }
         }, 100);

     

    DOCUMENT_HEAD.HBS Section

    <script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>

     

    STYLE.CSS section

    @keyframs animSlideTop {
      0% { -webkit-transform:translate3d(0,-100%,0); transform: translate3d(0,-100%,0); }
      100% { -webkit-transform:translate3d(0,0,0); transform: translate3d(0,0,0); }


    #7286425102107{
          display: none;

     

     

    Is @keyframes supposed to be in the Style.css? I tried it both ways, with and without. Either way the form still shows for people outside of the organization "Main Company".

     

    0
  • Brittany Mandel

    So I've implemented this and it works great for signed-in users. With that said, if the user is not signed in - the form isn't hidden. Any answers on how I can prevent anonymous users from seeing the particular form too?

    0
  • Damon Maranya

    We just don't allow user that are not signed in to submit tickets. Do you need users that are not logged in to be able to submit tickets?

    -1
  • Damon Maranya

    I never told you to do anything. I told you what we are doing, and I asked if there was a reason that you needed anonymous users to submit a ticket.

    So, I'm not really sure what you mean by "You're incorrect...". There isn't anything to be correct or incorrect about in my reply.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk