Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


RadioButton to ComboBox to TextBox---immediate commit issues

Explorer ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

Hi Everyone...

 

Well, I think this one has me stumped, and I have attached two files: a) a conceptual diagram that shows how the form is designed to work and what parts are working, and b) the actual form.

It starts with the user selecting a RadioButton choice, that populates a ComboBox of choices. The ComboBox values will change depending upon what RadioButton is selected. The ComboBox will change a TextBox based upon what the user selected from the ComboBox list. The TextBox values are set by a function that will set the possible values base on the ComboBox item selected...so far, ALL of that works.

 

The issue is with the ComboBox Array setting the TextBox...

First Issue: It does not set the value immediately, and Second: the resulting value of the TextBox, while coming from the Array choice, is not accurate to the list of choices in the ComboBox.

I think the issue is with SetChoiceOneArrayValues()....called by the Combox Validation method...

function SetExmeptionFieldValue(cChoice) { if( WhichOne=="Choice1")

   { this.getField("txEventStatus").value = cChoice //just to tell me routine arrived

var ArrayData = { "Please select exemption class...":{ statement: "ChoiceList 1 Item 1", }, C1Item2:{ statement: "ChoiceList 1 Item 2", }, C1Item3 :{ statement: "ChoiceList 1 Item 3", }, C1Item4:{ statement: "ChoiceList 1 Item 4", }}; this.getField("txChoiceMessage").value = ArrayData[cChoice].statement; } else { this.getField("txChoiceMessage").value = "Setting Array values did not work, darn!";} }

 

Any guidance would be kindly appreciated.

 

TOPICS
JavaScript, PDF forms

Views

36

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
community guidelines
Adobe Community Professional ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

Have you looked at the JavaScript console output? It reports an error when you select a value from the dropdown control:

 

ReferenceError: SetChoiceOneArrayValues is not defined
15:AcroForm:dbChoiceList:Keystroke

You have a document level script with that name, but it does not contain a function with the name in question. Fixing this may not fix your problem, but at least it will get rid of the error message, and your code will run without exiting a function due to the error condition. 

 

In general, when you get weird behavior, it's a good idea to add debug statements to the code that will report on the console what variables that you are interested are set to. You can do this using something like this:

console.println("Some Variable: " + someVariable);  // this assumes that someVariable is actually defined. 

You can also use the built-in debugger in Acrobat, but unless you know exactly which function to debug, you will spend a lot of time just single stepping through the application. By narrowing down where things go wrong ahead of time, you can then save a lot of time when acutally using the debugger. 

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
community guidelines
Explorer ,
Jul 16, 2021 Jul 16, 2021

Copy link to clipboard

Copied

LATEST

Thanks, Everyone.

 

This issue has been solved.

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