Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Allowing a user to enter text into a dropdown list and have the text saved to the list?

Explorer ,
Nov 29, 2022 Nov 29, 2022

I  am creating a recipe pdf file and I have created a dropdown list to allow a user to select the type of recipe to fill the in the dropdown text box ie; main course, dessert, appetizer and so on.

My question is if in the dropdown list I check the opiton to "allow user to enter custom text" and the user enters a text such as "pasta", can that text be saved in the dropdown list after the user has entered the text?

I have tried different ways but the text is never saved into the dropdown list.

Thanks for your help.

TOPICS
Create PDFs , How to , PDF forms
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 05, 2022 Dec 05, 2022

Hi @wislndixie 

 

Thanks for reaching out.

If you are following all the steps as it is and the "Allow user to enter the custom text" dialog is checked under the properties, then it should work.

Have you tried working on it at your end, can you enter the custom text? How the users have been opening the form, it also depends on that.

We have a similar discussion here, where this issue has been addressed and resolved. Please have a look 

https://community.adobe.com/t5/acrobat-discussions/need-help-with-a-dropdown-list-user-cannot-enter-... 

 

Thanks,

Akanchha 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2022 Dec 05, 2022

++Adding to the topic,

 

If you will enable the option for users to type in the name of a desired item in a combobox, and add that item into the existing list, you must employ a JavaScript script. In which case, you'll also need to provide the ability for the user to delete the new entries if they are mispelled or have errors after they hit enter, for example. Otherwise the list will display a bunch of unnecessary added items (making it a mess).

 

The best way to do this is to create a predefined list of recipe names that will remain always available and append the new added items to the end of that pre-defined list. 

 

Would you be able to share an example of your PDF?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2022 Dec 05, 2022

Hi,

Here is an On Blur Action script:

var theList=[];
for (var i=0; i<event.target.numItems; i++) theList.push(event.target.getItemAt(i))
var found=0;
for (var i=0; i<theList.length; i++) {
	if (theList[i]==event.value) {
		found++;
		break;
	}
}
if (!found) {
	theList.push(event.value);
	event.target.setItems(theList);
	event.target.value=event.value;
}

 @+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2022 Dec 06, 2022

...and as ls_rbls mentioned, if you add the ability to add an item you must add the ability to remove it:

 

 

var theList=[];
for (var i=0; i<event.target.numItems; i++) theList.push(event.target.getItemAt(i))
if (this.getField("chkBox").value=="Off") {
	var found=0;
	for (var i=0; i<theList.length; i++) {
		if (theList[i]==event.value) {
			found++;
			break;
		}
	}
	if (!found) {
		theList.push(event.value);
		event.target.setItems(theList);
		event.target.value=event.value;
	}
} else {
	for (var i=0; i<theList.length; i++) {
		if (theList[i]==event.value && i!=0) {
			theList.splice(i, 1);
			this.getField("chkBox").value="Off";
			break;
		}
	}
	event.target.setItems(theList);
}

 

 

@+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 21, 2025 Jul 21, 2025
LATEST

Easiest way is to copy/paste what you want to show in the drop down list then ADD (like you would for a new item) to the drop down list. however, I do not know how many characters will be allowed in a drop down list.  

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