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

short 10 fields value number min to max

Explorer ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

hello team,

i have 10 text fields

Text1

Text2

Text3

.

.

.

.

.

Text10

i want a solution how to short numbers min to max on this fields

e.g.

Text1 value = 1

Text2 value = 3

Text3 value = 2

2

7

6

5

Text8 value = 9

Text9 value = 10

Text10 value = 8

and i want system check the fields and short the number

1

2

3

4

5

6

7

8

9

10

any help?

TOPICS
Acrobat SDK and JavaScript

Views

350

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

You mean "sort" ?

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

Yes sorry for this mistake sort I mean

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

Read all values, sort the values, and save the values in the fields.

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

yes but how i sort the values?

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

try67​ I read this but this method short arrays .. I want to short fields...I must put the field values in array?

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

Yes.

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

try67​ thanks friend.. This is the only solution?

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

Probably not, but it's the easiest...

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

it is possible for any code example because i stuck...

Any fiend must check all other fields every time? if fields isn't a number but space or latter or something else how to avoid?

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

You have enough information to write the code yourself, I believe. If you have specific questions we'll be happy to answer them, but if you want someone else to do your work for you, you'll probably need to pay them.

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

i need a example not a full code, and i think this forum is for help not for pay to solve the problems...

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

Example of what, exactly?

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

i collect all the values, and put them in array, array short the values like this:

var points = [40, 100, 1, 5, 25, 10, 20, 38, 25, 12];

points.sort(function(a, b){return a-b});

now how to put the minimum value on Text1, and biggest on Text10? how to avoid values which are not numbers?

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 ,
Feb 11, 2019 Feb 11, 2019

Copy link to clipboard

Copied

Iterate over the array from start to end and apply each value to the corresponding field.

Just remember the array indices start from 0, not 1, so you need to add +1 to the array index number to get the correct index number for the fields.

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 ,
Feb 12, 2019 Feb 12, 2019

Copy link to clipboard

Copied

LATEST

i try this code to read text values :

var fieldst = ["Text1","Text2","Text3","Text4","Text5","Text6","Text7","Text8","Text9","Text10"];

for (var i in fieldst) {

    var f = this.getField(fieldst);

    if (f.valueAsString=="1||2||3||4||5||6||7||8||9||10")

{

var points = [,];

points.sort(function(a, b){return a-b});

}

}

now i want some help how to add this value fields on table when this value = number ....

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