Design Studio - assigning a value to detail row

Author
Messages
wwhite1
New Member
Posts: 2
New Member

    Hi,

    I am new to Design Studio and I am creating a custom form for our users to record missed punches.  On my form, I have 5 detail rows where a user can update data.  I have also created a button called "Clear Form" so that the user can click this button and reset all of the fields in the detail area to spaces (blank).

    I've created a function called Clear which I have mapped to my "Clear Form" button to reset all fields/rows in my detail area.  I've haven't been able to get all of my fields/rows to reset to spaces when the user clicks on the "Clear Form" button.  I have only been successful as resetting the fields in the 1st row.

    Any help would be greatly appreciated.  I've tried so many different things but nothing has worked.  Below is the coding that I have (right now) for the Clear function.

    function Clear()
    {
    // when user clicks on Clear Form button, set all fields in
    // detail area to space - user wants to start over with entry

    // works but only for row 1
            lawForm.setFormValue("text5","");

    // doesn't work
     lawForm.setDataValueById("text5","",0);
     lawForm.setDataValueById("text5","",1);

    // doesn't work
            lawForm.setDataValueById("_f16r0","",0);
            lawForm.setDataValueById("_f16r0","",1);

    }

     

    Terry P
    Veteran Member
    Posts: 234
    Veteran Member
      You switched from setFormValue to setDataValueById

      This should work, but test on your own

      for (var rowNum = 0; rowNum < 5; ++rowNum)
      {
      lawForm.setFormValue("text5","",rowNum)
      }
      wwhite1
      New Member
      Posts: 2
      New Member
        This code works. Thank you for your help!
        ---