Adding square meters symbol to a number field

Hello,

Is there a simple way to add the “m²” as unit for a number field. Please see the image attached.

Thanks for your help

Do you have a link to the page on your site where we can see the form? I assume from the screenshot the the input field is as wide as the underline, which means you cannot add the text AFTER the input (which would have been my suggestion.) Share a link if you can

Hi Chris, thanks for your reply. I tried to use :after in my css but as you imagine with no luck. Here is the link to the forrn : https://maisonlouis.paris/questionnaire/2. For info, I used lastform add-on for styling. Thanks

I was able to create and use a background image in the input, but that puts it all the way to the right. It looks like this:

I created the image using the same font, same font size, same font weight and same background color as the input. I’m not sure I checked the font color.

This is the image I created:

This is the CSS I used to add it to that field in your form:

body .gform_wrapper input#input_2_12 {
	background: url(https://gravityforms.chrishajer.com/wp-content/uploads/gravity_forms/files/m2.png) no-repeat right 10px center;
	// optional border to see where the input is
	border: 1px solid #000;
}

That CSS can be added to your theme stylesheet, or use the Appearance Customizer (Appearance > Customize > Additional CSS)

The border is there only so I could see where the input was.

If you want to use something like this, please download that image and store it on your server, or create a new image tweaked to your liking.

Let me know if you have any questions.

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.