You are viewing limited content. For full access, please sign in.

Question

Question

Add a "$" in front of a Number Field

asked on October 12

Hello Everyone!

 

Hoping someone can help me with some simple javascript.  I have the following form with fields relating to wage.  These fields are just the standard numerical fields and not currency fields because I needed 4 places after the decimal.  Does anyone know how to enter a dollar sign ($) at the beginning of these fields using javascript or some sort of other magic?

Thanks,

Drew

Capture.PNG
Capture.PNG (1016.7 KB)
0 0

Answer

SELECTED ANSWER
replied on October 13

Hi Drew,

Give the fields the CSS class "field-dollar-sign", then add the following CSS to the form:

.field-dollar-sign .cf-field:before {
  margin-right: 2px;
  content: "$";
}

 

3 0
replied on October 13

Perfect! Exactly what I was looking for Jim! Thanks so much

1 0

Replies

replied on October 13 Show version history

You should use a Currency field instead of a number field.

Another easy option is to add the $ at the end of the Field Label.

1 0
replied on October 13

Thanks for the reply Bert but I had to use the numerical field because I needed four places after the decimal and from what I could see, the currency field only allows for two.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.