Skip to main content
Known Participant
April 21, 2021
Question

Find and replace depending upon dropdown selection

  • April 21, 2021
  • 2 replies
  • 488 views

Hi

 

In my PDF (built using Acrobat Pro) I have a number of fields containing statements relating to students.  For each field, the user currently edits the default text to match the student’s gender – e.g., a statement might read:

 

“[He/she] accepted a place to study….etc” – with the user deleting either "he" or "she" as a appropriate. 

 

It would be really useful if there were to be a script to essentially find and replace all “he/she” “his/her” and “him/her” statements in text boxes with the correct gender pronoun depending upon gender selection from a dropdown list.  Would this be possible?  Thanks.  

This topic has been closed for replies.

2 replies

Amal.
Legend
April 21, 2021

Hi Mark

 

Hope you are dong well and sorry for the trouble. As described, you want to find and replace all “he/she” “his/her” and “him/her” statements in text boxes with the correct gender pronoun depending upon gender selection from a dropdown list using script.

 

Please check out the help page https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_developer_guide.pdf and see if that works for you.

 

Regards

Amal

try67
Community Expert
Community Expert
April 21, 2021

I've created a (paid-for) tool that does just that: https://www.try67.com/tool/acrobat-search-replace-text-in-form-fields

If you wish, I could incorporate it into your form so that it automatically applies those changes based on a selection in a drop-down, although this is not as simple as it seems, and I would think twice if I were you before deciding for people (especially students...) what pronouns they should use.

Mark5EC1Author
Known Participant
April 21, 2021

Good point.  You’re certainly right to advise caution with regards ascribing gender pronouns.  I worked something out with event.value.replace, but I think there is too much scope for error when automating the gendering of text – best left be! Thanks for the advice.