Checkbox value is always on

Sort:
You are not authorized to post a reply.
Author
Messages
kdcoate
Veteran Member
Posts: 44
Veteran Member

    I have a Design Studio UI form created to kick off a New User request process.  On the form I have several checkboxes for Network Access, Blackberry, etc...  When I try to read the value of those checkboxes, it's always 'on' regardless of whether the box is checked or not.  I've tried various methods (lawForm.getFormElement("chkbb").value) but no matter what I try the value is either 'on' or null.  I'm sure there's a simple solution, but I haven't found it.  Anyone have success returning checkbox values?

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      You have to go into the Checkbox properties and set the checked and unchecked data values. Then you can get the data value with your script.
      David Williams
      David Williams
      Veteran Member
      Posts: 1127
      Veteran Member
        Then use lawForm.getFormValue("chkbb")
        David Williams
        kdcoate
        Veteran Member
        Posts: 44
        Veteran Member
          Thanks David - I had the bbYes and bbNo values assigned in the checkbox properties, but I couldn't figure out how to return that either. I just tried what I should have tried in the beginning (lawForm.getFormvalue("chkbb")) and, of course, that works. I was over-complicating it.
          John Henley
          Senior Member
          Posts: 3348
          Senior Member
            You can also check the checked property on the raw HTML element:
            document.getElementById('_l21').checked
            Thanks for using the LawsonGuru.com forums!
            John
            kdcoate
            Veteran Member
            Posts: 44
            Veteran Member
              Thank you both. It's working as expected now.
              You are not authorized to post a reply.