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

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


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 ●●●●●
  • 228 replies
  • Answer
  • June 4, 2020

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
  • 4 replies
  • June 4, 2020

Thank you so much! It worked like a charm.


Leave a Reply