Skip to main content
Known Participant
March 6, 2023
Question

Looking to add parenthesis to text box

  • March 6, 2023
  • 1 reply
  • 3403 views

I am looking to add parenthesis to a text box and I think I need to make a javascript to complete the task. Would anybody be able to provide some assistance please.

1 reply

try67
Community Expert
March 6, 2023

You mean around whatever text the user enters?

If so, you can use this code as the field's custom Format script:

 

if (event.value) event.value = "(" + event.value + ")";

Known Participant
March 7, 2023

This is right on the money. Thank you greatly

Follow-up questions, I have one text box that needs the parenthesis but the other copies do not. Is this possible thru script or do I have to make separate text boxes to technically do the same thing

Nesa Nurani
Community Expert
March 8, 2023

Im sorry, would you mind explaining as I am unfamiliar with adobe. It's like jumping into a manual car and never being in one before.


If you give multiple fields the same name they act as one field, and they all will have the same value, so use unique names.