Code

Display/Hide Items based on Count

Hide/show elements on your Webflow Memberstack site based on a conditional value with this Javascript snippet. A great way to implement a credit based system or value based conditional logic for your Memberstack Webflow site.

Display/Hide Items based on Count preview

Hide/show elements on your Webflow Memberstack site based on a conditional value with this Javascript snippet. A great way to implement a credit based system or value based conditional logic for your Memberstack Webflow site.

How to add it

  1. Update the Javascript code based on your requirements
  2. Utilize Element IDs and setup Memberstack user forms and update those names

The code

Javascript
                      <!-- Add to closing body section -->
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script>
    function Go() {
        var credit = $("#credit").val();
        if (credit == 0) {
          $("#signUpButton").hide();
        }
        if (credit == "") {
          $("#signUpButton").show();
        }
        if (credit > 0) {
          $("#signUpButton").show();
        }
      }
      $(document).ready(function () {
        Go();
      });

      $("#credit").on("keyup keypress", function (e) {
        Go();
      });
    </script>

                    

Browse similar code snippets

Language

Related Webflow questions

All answers →

Similar code snippets

All code snippets →