short 10 fields value number min to max

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

225

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

short 10 fields value number min to max

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

226

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

Copy link to clipboard

Copied

You mean "sort" ?

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

Yes sorry for this mistake sort I mean

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

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

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

yes but how i sort the values?

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

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
Reply
Loading...
Feb 09, 2019 0
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?

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

Yes.

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

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

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
Reply
Loading...
Feb 09, 2019 0
Feb 09, 2019

Copy link to clipboard

Copied

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

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
Reply
Loading...
Feb 09, 2019 0
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?

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
Reply
Loading...
Feb 11, 2019 0
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.

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
Reply
Loading...
Feb 11, 2019 0
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...

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
Reply
Loading...
Feb 11, 2019 0
Feb 11, 2019

Copy link to clipboard

Copied

Example of what, exactly?

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
Reply
Loading...
Feb 11, 2019 0
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?

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
Reply
Loading...
Feb 11, 2019 0
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.

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
Reply
Loading...
Feb 11, 2019 0
Feb 12, 2019

Copy link to clipboard

Copied

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 ....

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
Reply
Loading...
Feb 12, 2019 0