Is there a way to add a symbol before and/or after a multiple text entry? | Experience Community
Skip to main content
Solved

Is there a way to add a symbol before and/or after a multiple text entry?

  • Jun 3, 2020 9:57 PM UTC
  • 2 replies
  • 495 views

Forum|alt.badge.img

I have a text entry with 6 form fields. I would like to add a $ before 2 of them and a % after 1 of them. Is this possible? I found a Java code in the community to add a % sign and it worked but it added it to each form field. I need to be able to leave some fields blank and be able to add $ and %. Any help would greatly be appreciated....Thanks in advance.

Capture.PNG

Best answer by PraDeepKotian_XM

Hi,
You can use the below code to add symbol after the text entry and by doing slight modification you can place the symbol after required text entry.

jQuery('input[type="text"]').eq(1).after(" $"); //this will place $ after 2nd text entry box
jQuery('input[type="text"]').eq(2).after(" %") //this will place % after 3rd text entry box

View original

2 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • Answer
  • Jun 4, 2020 2:03 AM UTC

Hi,
You can use the below code to add symbol after the text entry and by doing slight modification you can place the symbol after required text entry.

jQuery('input[type="text"]').eq(1).after(" $"); //this will place $ after 2nd text entry box
jQuery('input[type="text"]').eq(2).after(" %") //this will place % after 3rd text entry box


Forum|alt.badge.img
  • Author
  • Jun 4, 2020 6:48 PM UTC

Thank you so much! It worked like a charm.