3 Replies Latest reply on Jun 6, 2017 4:27 PM by Insomniaddict

    Help with javascript code

    BergLino Level 1

      Guys, I need some help.

      I am making a form where there is a column with actions taken and another column with the status of these actions, where it can be pending (blank field) or resolved (OK). I created a field of implemented actions (OK) and wanted a code in javascript that counted all the fields with "OK".
      Something like .... if the field has ok he would count and give me the total of ok.
      can you help me?



        • 1. Re: Help with javascript code
          Test Screen Name Most Valuable Participant

          What have you tried? What happens?

          • 2. Re: Help with javascript code
            BergLino Level 1

            Good Morning.

            In fact I ended up forgetting one detail. These two parameters I commented, will be through the drop down menu, where in the blank option, I would like the value to be "0" and when I select OK the value was "1" and then in a specific field, count all the lines that Contain the value "1" that would be all OK.
            At the moment I have not done anything yet, as I am trying to study jvascript and thought about using the if and else command. I do not know if it would be the right one, so I asked for help in working out this code for me. So with this help, I will try to understand the syntax of the commands and try to proceed with others.




            • 3. Re: Help with javascript code
              Insomniaddict Level 1

              Haven't used JScript with Adobe yet (I just joined for that reason), however the easiest method would be to sum the values, since you know they will be integers.  If you're planning on using more values later, you could use an offset system (eg "OK" is 1, "Wait" is 100, "Cancel" is 10,000 etc).


              If..Else will also work, but I would only use this if you're using something like a for..each loop with a counter.