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.
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
- Update the Javascript code based on your requirements
- 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>