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

Can't get autopopulate dropdowns to work by any method

Explorer ,
Sep 16, 2022 Sep 16, 2022

Copy link to clipboard

Copied

I am going to please ask for help again. I have basically started from scratch on this. I have figured out how to get one piece of this to work, but not the other.

On my form I have a "MasterList" dropdown set to accept custom text from the other 18 dropdowns "Location" (I don't care if it is Location 1.0, etc or Location1, etc. whatever will work). These also allow custom text entry. As it stands, this part works. I can add to the MasterList all day long from these fields with the validation script I have. I finally got that part figured out. I need it to work this way and also allow me to clear the Location dropdowns with my clear form button and on page load. This also is currently working.

 

The part I cannt get to work by any code I have tried, whether document level or in the validation script, or otherwise is this: I want to autopopulate the 18 Location dropdowns with all of the items in the MasterList, not just one item and not just a blank like it is currently doing. Always blank fields. MasterList is already populated by the option tab with the initial list plus whatever is added from the other fields. I need this to be dynamically autopopulated FROM all of  the current MasterList items to the 18 Location dropdowns. Obviously the 18 boxes will be an exact copy of the MasterList when the box is clicked on. I am NOT using an "ADD" button to do this, it must occur in the background The MasterList will be hidden in the final form.

Can someone please help me with this final piece? I have wasted far too much time on this. I don't kn0w what I'm missing and some code from other threads actaully create syntax errors or otherwise or break the part I do have working.  I have attached the version that is working as far as adding to the MasterList. If there is a better way than repeating the same validation script 18 times that would be nice too, but I just want it to work.

 

Thank you very much. I hope this is easier to troubleshoot than my previous posts on the subject.

TOPICS
General troubleshooting , How to , JavaScript , PDF forms

Views

885

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
community guidelines
Community Expert ,
Sep 16, 2022 Sep 16, 2022

Copy link to clipboard

Copied

Did you get a chance to see the last file that I fixed and shared with you back on 5th September in the older thread?

 

If you missed it here's the link:

 

 

If you already tested it and this not what you were asking help with then disregard.

 

 

Votes

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
community guidelines
Explorer ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

I'm still testing this. You removed the "MasterList field altogether? I checked sort on the boxes, but they are not sorting. Location1 has two blank spaces and I can't delete either one so that there is only one. I "downloaded a copy" of the shared file and I have a status bar that is stuck on "Preparing the shared file"? If you can help me with these few things I will test thoroughly and ket you know. To answer your question, I did not see this until you asked. Thanks for the work.

Votes

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
community guidelines
Explorer ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

Nice work, but still not quite what I want. I really want to be able to clear the field, but retain the custom text entered. All fields clear with the clear form button, but not on load. And when cleared the custom entries go away completely...not what I want. I couldn't get arrays to work right. This sample does populate the 18 fields, but does not retain the entries if cleared. The form should load with blank fields, but have all entries available.

Votes

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
community guidelines
Community Expert ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

That is an easy fix in the script, I can fix that.

 

So instead of using the setItems() method that I used , what you actually need is a simple reset of the 18 comboboxes just to default to the null or empty string, correct?

 

On a side note, I wanted you to evaluate different ways of achieving similar results.

 

So if you noticed in this last sample, there is no need for a hidden field, nor a global variable stored as a function; everything updates dynamically on real-time.

 

For instance, since a keystroke script can listen to the rc event, I was able to incorporate the validation inside of the custom keystroke itself by assigning an rc event, thus eliminating the excessive additional validating scripts for each combobox.

 

I also found even a quicker way of populating data using a variation of the same script as a field event.

 

I'll keep you updated. Hopefully you will have a working form by tomorrow.

 

Votes

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
community guidelines
Explorer ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

I think that might be what I want. It would take some testing to know for sure.

Votes

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
community guidelines
Explorer ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

LATEST

Any update?

Votes

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
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

When do you want this to happen? Whenever the user enters a new item into one of the drop-downs?

Votes

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
community guidelines
Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Yes, if row one has a new entry, it should be available in Row 3 or 4 or whatever, ideally, but definitely in the MasterList the next time the file is opened (and likewise available in all the dropdowns as well, upon opening). Not sure about the MasterList being saved when the file is closed...I haven't really gotten to that point yet.  I don't want them to have to type a repeat location every month or within the same month. It's an additive list that should be available any time the form is filled out.

 

I hope that clarifies it and thanks for responding.

Votes

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
community guidelines
Community Expert ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

If you save the file when closing it, the list will be saved, just like anything else in it. If you don't, the items added to it since the last save will be lost, of course.

Votes

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
community guidelines
Explorer ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

Is there a way to autosave upon closing?

Votes

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
community guidelines
Community Expert ,
Sep 23, 2022 Sep 23, 2022

Copy link to clipboard

Copied

Only if you can install a script on the local machine of each user.

Votes

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
community guidelines