Dialog box, feedback of 2 values for radio buttons selection

Contributor ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

In a dialog box script, is it possible to get the feedback of 2 values in a same function?

Such as below, I only get the "resp" answer. I did several tests without any success...

Doing it with 2 functions is working fine, but I'm pretty sur it is possible with a single function.

Thanks

myQuestion: function (results) {
	for (var i=0; i<=2; i++) {
		if (results["Rad"+i]) {
			switch (i) {
				case 0:
					var resp=1;
					var otherResp=4;
					break;
				case 1:
					var resp=2;
					var otherResp=5;
					break;
				case 2:
					var resp=3;
					var otherResp=6;
			}
		}
	};
	return resp;
},

 

TOPICS
How to, JavaScript, PDF forms

Views

58

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

correct answers 2 Correct Answers

Most Valuable Participant , Mar 05, 2021 Mar 05, 2021
You can return an array that contains both values, like this: return [resp, otherResp];

Likes

Translate

Translate
Adobe Community Professional , Mar 05, 2021 Mar 05, 2021
You can put the values in an array and return the array.

Likes

Translate

Translate
Most Valuable Participant ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

You can return an array that contains both values, like this:

return [resp, otherResp];

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
Contributor ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

LATEST

Thank you, that's what I'm just thinking...

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 ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

You can put the values in an array and return the array.

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