Jump to content

LeoEchero

Member
  • Posts

    2
  • Joined

  • Last visited

LeoEchero's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. @tuanphan I am not a circle member and I won't qualify I suppose. I only manage 2 websites at this point. Is there anything else I can do?
  2. I used to have simple HTML code block to add the character count and to limit a number of characters allowed in the text area of the contact form. However, it looks like sometime this summer Squarespace updated the variables for the contact forms which broke the code. Is there a list of new variables anywhere? I think messageField is the problem but it could be anything else at this point. Please help. Here's what it looked like: <script> document.addEventListener("DOMContentLoaded", function() { var messageField = document.querySelector("#message"); var maxLength = 200; messageField.setAttribute("maxlength", maxLength); var counter = document.createElement("div"); counter.classList.add("char-counter"); counter.innerHTML = "<span>" + maxLength + "</span> characters left"; messageField.parentNode.insertBefore(counter, messageField.nextSibling); messageField.addEventListener("input", function() { var currentLength = messageField.value.length; var remaining = maxLength - currentLength; counter.querySelector("span").innerHTML = remaining; if (remaining < 0) { messageField.classList.add("is-error"); } else { messageField.classList.remove("is-error"); } }); }); </script>
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.