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

Dropdown Box Selection initiates "Material Code" to appear

New Here ,
Jun 29, 2016 Jun 29, 2016

Hey Everyone,

I am in the beginning stages of revamping tan editable work order form for my company.  For the time being I have created a few "mock" drop down boxes.  The idea here would be to select a one of the material types from the drop down box and have our corresponding material/item number appear in the "CODE" column section in the lower left portion of the form.

How would you go about doing something like this?  I have searched and searched the web and not come up with what I need.  Any help would be greatly appreciated!

I don't know if using the drop down boxes makes creating this form any more difficult or not.  I am open to utilizing the various check boxes on the form as well.

Basically my companies material/item numbers "codes" would need to be running behind the scenes.  We only have about 20 of them.  This is totally doable right?

Screen Shot 2016-06-29 at 10.00.57 PM.png

TOPICS
Acrobat SDK and JavaScript
500
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 ,
Jun 30, 2016 Jun 30, 2016

When you add an option to a drop-down field you'll notice that there are two values, the Item value and the Export Value.

The former is the display value, what the user sees. The latter is the actual value of the field when that selection is made.

So if you put the material type as the display value and the material code as the export value it will be easy to copy it over to the "Material Code" field. All you'll have to do in that case is use this code as that field's custom calculation script:

event.value = this.getField("Material Type").valueAsString;

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
New Here ,
Jun 30, 2016 Jun 30, 2016

How would I make the Export Value appear in the "Materiel Code" field?  I entered the script into the Run custom validation script field but I'm not certain what to do next.   Does the part inside the quotation marks need to have the same name as the item that I select from the dropdown box?

For example I need "VIN250" to show up in the "CODERow1" box if the word "Banner" is selected from the drop down box.

Screen Shot 2016-06-30 at 8.52.38 PM.png

Screen Shot 2016-06-30 at 8.52.49 PM.png

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
New Here ,
Jun 30, 2016 Jun 30, 2016

I moved the script into the field custom calculation section.  Now I'm just wondering how to make the Export Value show up where I need it to.

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
New Here ,
Jun 30, 2016 Jun 30, 2016

Ok so now I have gotten closer to my goal.  I entered it like this and I have my "VIN250" code showing up in "CODERow1".  But it seems to be permanently there.  I only want it to show up if a certain item is selected.

Thank you for your help

Screen Shot 2016-06-30 at 9.12.41 PM.png

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 ,
Jul 01, 2016 Jul 01, 2016

No, the part in the quotations marks is the name of the field. You did it correctly.

The only other thing I would recommend is to make sure that the option to commit the selected value of the drop-down field is ticked (you'll find it under Properties - Options). Otherwise the value will only update when you exit the field, which can be a bit confusing.

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 ,
Jul 01, 2016 Jul 01, 2016

Wait, why did you add a validation script to the drop-down field? That was not included in my instructions.

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
New Here ,
Jul 06, 2016 Jul 06, 2016

That was a mistake.  I went back through your instructions and then realized my error.  So that is why I had the second screen shot from 6:15PM showing my most current state of the project.

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
New Here ,
Jul 06, 2016 Jul 06, 2016
LATEST

Ok yes I have the "commit selected value" checked off.  My issue now is... should the script be set up in some sort of loop?

I have different product codes that need to be input in our "CODE" column.  So if I select something from the "Banner Types" category, I need VIN250 to pop up or if I select something from "Dropdown_Alum" category I need VINXXX to pop up and so on.

Currently with the way I have it set up our material code is permanently stuck in the code column as you can see in the shot.  VXXXXX is behind "CODERow1".  Why is this happening?  What should I do differently?

Screen Shot 2016-07-06 at 9.38.22 PM.png

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