Javascript – hide Submit section

0

In a survey linked to Salesforce, we would like to prevent a user from completing the survey twice.

We have a dedicated field to know if it is already filled-in on Salesforce side.

On Survey Gizmo side, we would like to hide the Submit section entirely.

 

Following JS code helps hiding the Submit button:

$(function(){

  $(‘#sg_SubmitButton’).hide();

});

 

Do you have the JS code to hide the Submit section entirely ?

Is there any other way to hide/disable this Submit section ?

 

Thanks.

 

 

 

 

 

cedricbartieraccentureco asked
    0

    Thanks Cliff.

    In fact, sg-footer being a ClassName and not the Id like sg_SubmitButton, it did not work with $(“.sg-footer”).hide();.

    I tried the following code and it seems to be ok to hide the footer:

    $(function(){
      document.getElementsByClassName(‘sg-footer’)[0].style.visibility=’hidden’;
    });

    I just need now to manage the logic, many thanks for your time.

    cedricbartieraccentureco answered
      0

      Hi,

       

      You can hide everything in the footer by using this Javascript:

       

      $(function(){

      $(“.sg-footer”).hide();

      });

       

      This should hide all buttons and progress bar.

       

      Let me know if that doesn’t work for you!

       

      Thanks,

       

      Cliff

      Cliff McGrupp answered
        0

        The field to determine if the user already completed the survey is already retrieved from Salesforce with a Pull action.

        There is only one page, that is why I try to hide all the Submit section.

        Actually, the code I use only hide the Submit button but not all the look and feel around it (with the percentage bar).

        Do you know how to hide all the elements around the Submit button ?

         

        cedricbartieraccentureco answered
          0

          Hi,

           

          Can you pull in the field that determines if the respondent has completed the survey or not using a Salesforce pull action?

           

          Salesforce pull documentation:

          http://help.surveygizmo.com/help/article/link/salesforce-pull

           

          If you can pull this field into your survey, you should be able to conditionally hide the submit button using a Javascript action that has logic applied to it.

           

          I would suggest placing this javascript action on the first page of your survey so that the respondent can’t get passed the first page, but of course this would be up to you!

           

          If you did this just be sure to change your Javascript to the following:

           

          $(function(){

          $(‘#sg_NextButton’).hide();

          });

           

          I hope this is helpful to you!

           

          Thanks,

           

          Cliff

          Cliff McGrupp answered
            ×

            Login

            Question stats

            • Active
            • Views2034 times
            • Answers4 answers
            • Followers0 followers