9 Replies Latest reply on Jul 14, 2015 2:53 PM by try67

    Count Fields with If Then Statement

    steven85265304

      Greetings,

       

      I am using Adobe Acrobat Pro XI.  On a form I have created, there are fields named "RLRow1", RLRow2", RLRow3" etc all the way up to RLRow13 assuming there are 13 rows of data needing to be entered.  Staff is required to enter either the letter "L" or the letter "R" in these fields.  I have already added the Custom Format Script of "event.value = event.value.toUpperCase();" to convert the text to uppercase.  On this same form I have a field called "Total L" and a field called "Total R".  I would like to add javascript function which counts the number of "L" from RLRow1, RLRow2 etc and puts the total in the "Total L" field.  Likewised, I would like to add javascript function which also counts the number of "R" from RLRow1, RLRow2 etc and puts that total in the "Total R" field.  I am assuming it would be some type of If Then statement, but I am not familiar enough with Javascript.  I hope this is not too confusing.  Can anyone help with this?