2

I want to show a number superscript like <sup> 2 <sup> in a Contact Form 7 placeholder. But I have just discovered that you can apparently use no HTML tags in the CF7 elements. I planned it like this:

[text your-size placeholder "area in m <sup> 2 </ sup> approx."]

Krupal Panchal
  • 1,553
  • 2
  • 13
  • 26
André We
  • 21
  • 1
  • 1
    Possible duplicate of [Placeholder in Contactform 7 - Wordpress](https://stackoverflow.com/questions/24309750/placeholder-in-contactform-7-wordpress) – Senpai.D Oct 06 '19 at 11:10

1 Answers1

1

Contact form 7 doesn't allow HTML in the placeholder. So, we can do that with the jQuery and Unicode. Add the below code in your js file.

jQuery(document).ready(function($){

    $( '#FormID #area' ).attr( 'placeholder', "area in m\u00B2 approx.");
    // here #FormID is the ID of form and #area is id of your text field.

});
Krupal Panchal
  • 1,553
  • 2
  • 13
  • 26