Placeholder for Multiple Line Text Area

  • 4 January 2019
  • 5 replies
  • 399 views

Userlevel 3

To have a placeholder text for multiple line text area fields in your forms, you can use this small script below:

WARNING: This script requires jQuery. If you need a hand adding jQuery to your page, you can check our documentation: Installing jQuery on your Landing Page

Step by Step

  • Make sure you have a multiline text are on your form.

  • Copy and Paste the text below as a Javascript Script, select to apply the script after body tag.

         <script>
              $(document).ready(function () {
                  $('form').find("input[type=textarea], textarea").each(function (ev) {
                      if (!$(this).val()) {
                          $(this).attr("placeholder", "Type the placeholder text here!!!");
                      }
                  });
              });
          </script>
    
  • Change the Type the placeholder text here!!! to your desired placeholder text.

  • Save and Republish your page.

Check out an example page here: https://tst.brunagarcia.tk/multi-line-placeholder/


5 replies

Hello! I have done in the same way that you explain but it´s not working… Any idea about the problem?
The landing is : https://ads.adspromarketing.com/agencia-marketing-barcelona/

Userlevel 3
Badge +1

@adspro I checked you page…

You are missing jQuery on it, so its an easy fix!
Please check the script library that says jQuery (1.4.2):

03%20PM

Hiya

Perfect, now it´s working. A lot of thanks!

I do not see the Script Libraries on my page. Where can I find it?

i just add the script but not working kindly help to solve the issue

Reply