2 Replies Latest reply on May 12, 2015 12:00 PM by gkaiseril

    MATH.CEIL

    klothos Level 1

      Hello

      I have Text1=44.09

      Textfield1=Text1+10=54.09=55 math.ceil

      i want

      Textfield2=Text1+54.09=98.18=99 math.ceil

      Textfield3=Text1+98.18=142.27=143 math.ceil

      Textfield4=Text1+142.27=186.36=187 math.ceil

      Textfield5=Text1+186.36=230.45=231 math.ceil

      .

      .

      .

      till Textfield250

      Thanks

        • 1. Re: MATH.CEIL
          klothos Level 1

          1.How can i give to the general script my own auto number name to 10 or more textfields?

          2. How  can i move using tab with column

          • 2. Re: MATH.CEIL
            gkaiseril MVP & Adobe Community Professional


            JavaScript is case sensitive. The method is "Math.ceil(number)".

             

            Do you know how to compute the value by formula for each field in the sequence?

            Yes, there is formula for computing this sequence.

             

            You can even compute the field names.

             

            You will needed to use custom JavaScript to create the code and where you place the code will also affect when the code will run.

             

            You can use the "for" statement to create a loop to compute the field names and the sequence value for the computed field.

             

            Have you looked at any tutorials on creating forms?

             

            // custom calculation script for field Text1;

            var Text1 = event.value;

            var cResultField = "";

            for(var i = 0; i < 250; i++) {

            cResultField = "Textfield" + (i + 1); // compute field name;

            nValue = Number(Text1) + 10 + (i * 44.09); // compute value in sequence;

            // debugging statement to ceck computed field name, value, and rounded value;

            // console.println(i + ": " + cResultField + " value: " + nValue + " Math.ceil: " + Math.ceil(nValue));

            this.getField(cResultField).value = Math.ceil(nValue); // assign value to field;

            }