11 Replies Latest reply on Dec 14, 2013 8:12 AM by try67

    Javascript forms: grouping fields then clearing them

    RJKnyumc Level 1



      I have a log form that repeats a row of fields several times like so:










      There are multiple fields per row but all follow this sort of sequence.


      I'm a complete novice in javascript so I'm probably using the most sloppy method of clearing them all: getField("Text1").value = getField("Text1").defaultValue; for 22 rows of 8 or so items. The trigger is typing "reset" into a separate field that then runs the above series of commands. The reason for this is that adobe reader on iOS does not support a resetForm() function or support the reset button.


      Is there a way to group all Date(i) together into another variable, DATE let's say, and then use a getField("DATE").value = getField("DATE").defaultValue; command to clear everything quickly? My method takes 30 seconds or so to complete since it goes through all fields individually clearing them, even if they're blank.


      Any help is greatly appreciated