Hiding a Form From All Users Except Member of an Organization

33 Commentaires

  • 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 Kay'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

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk