Highlighted

Populate multiple drop down list selections and custom text in one text field in a form

New Here ,
Jul 15, 2020

Copy link to clipboard

Copied

Hi there, thank you in advance to anyone who can assist! 

I did see a similar question but I wasn't able to solve my issue with the scripts that were provided on that thread..I have tried writing my own script by I haven't been able to get it right.

 

I have a text field that populates based on the selections from a list box using the code below:

 

var v = this.getField("Components").value;

if (typeof v=="object") event.value = v.join(", ");

else event.value = v;

 

This code works for the multiple selections, but if I enter custom text, it automically disappears when I click out of the box. 

 

If possible, I need a code that allows for multiple selections as well as the ability to type in and save custom text, with each selection seperated by a comma.

 

Thank you!

Topics

PDF forms

Views

29

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Populate multiple drop down list selections and custom text in one text field in a form

New Here ,
Jul 15, 2020

Copy link to clipboard

Copied

Hi there, thank you in advance to anyone who can assist! 

I did see a similar question but I wasn't able to solve my issue with the scripts that were provided on that thread..I have tried writing my own script by I haven't been able to get it right.

 

I have a text field that populates based on the selections from a list box using the code below:

 

var v = this.getField("Components").value;

if (typeof v=="object") event.value = v.join(", ");

else event.value = v;

 

This code works for the multiple selections, but if I enter custom text, it automically disappears when I click out of the box. 

 

If possible, I need a code that allows for multiple selections as well as the ability to type in and save custom text, with each selection seperated by a comma.

 

Thank you!

Topics

PDF forms

Views

30

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 15, 2020 0

Have something to add?

Join the conversation