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?
Copy link to clipboard
Copied
You mean "sort" ?
Copy link to clipboard
Copied
Yes sorry for this mistake sort I mean
Copy link to clipboard
Copied
Read all values, sort the values, and save the values in the fields.
Copy link to clipboard
Copied
yes but how i sort the values?
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Yes.
Copy link to clipboard
Copied
try67 thanks friend.. This is the only solution?
Copy link to clipboard
Copied
Probably not, but it's the easiest...
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?
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.
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...
Copy link to clipboard
Copied
Example of what, exactly?
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?
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.
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 ....