Setting a Checkbox on intial Load

 1 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Robert Spurr
Veteran Member
Posts: 130
Veteran Member
    I've created a design studio modification of RQ10 for RSS approval with a checkbox. I want to inquire on a table and set the checkbox based on the value I retrieve. I have no problem reading the value to update the table but reversing the process doesn't seem to work. Does anyone have an example of setting a checkbox?

    Thanks
    Robert
    Robert Spurr
    Veteran Member
    Posts: 130
    Veteran Member
      I solved the problem and thought I would share. My not be the best solution but it worked. My first problem was that I couldn't change the state of the checkbox (Checked Unchecked)

      if(vCols[20].firstChild.data == "Y")
      {
      lawForm.setElementValue("_l252","Y");
      }else
      {
      lawForm.setElementValue("_l252","N");
      }

      if(vCols[21].firstChild.data == "Y")
      {
      lawForm.setElementValue("_l253","Y");
      }else
      {
      lawForm.setElementValue("_l253","N");
      }

      This however caused another problem. When I try to update a table if was setting the values to false even if the checkbox was checked. As it turned out the solution above only effected the form but not the current state so I had to read the current state instead.

      var vCheck = lawForm.getElementValue("_l252");
      if(vCheck == "Y")
      {
      vCollection = vCollection + "&CAP-FLAG01-CD=Y";
      }else
      {
      vCollection = vCollection + "&CAP-FLAG01-CD=N";
      }

      var vCheck1 = lawForm.getElementValue("_l253");
      if(vCheck1 == "Y")
      {
      vCollection = vCollection + "&CAP-FLAG02-CD=Y";
      }else
      {
      vCollection = vCollection + "&CAP-FLAG02-CD=N";
      }

      Hope this helps