Placeholder texts to input fields

If you would like to add placeholder texts to input fields in Webflow, such as the checkout form you can use my quick solution here.

Steps:

  1. Add a data attribute to all input fields that should use a placeholder text.

Screenshot 2021-09-16 at 09.40.31

  1. Add this script snippet to the page (or the project).
<script>
  $(document).ready(function(){
    $('input').each(function(index) {
  		$(this).attr("placeholder", $(this).attr("data-placeholder"));	
		});
  });
</script>

Here is my site Read-Only: LINK
(how to share your site Read-Only link)

1 Like

Hello.

It doesn’t work anymore. I am really trying to find something, but nothing is working. It’s a pretty basic style that Webflow e-commerce doesn’t support… unbelievable.

1 Like

Got it working with this script:

<script>
  window.onload = function() {
    document.querySelectorAll('input').forEach(function(input) {
      input.placeholder = input.getAttribute('data-placeholder');
    });
  };
</script>

2 Likes

Brilliant stuff! Thank you so much!! And while I work on it, I just can’t stop swearing at Webflow for launching such a RAWWWWW product