Checkbox value is always on

 5 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
kdcoate
New Member Send Private Message
Posts: 0
New 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 Send Private Message
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 Send Private Message
Posts: 1127
Veteran Member
Then use lawForm.getFormValue("chkbb")
David Williams
kdcoate
New Member Send Private Message
Posts: 0
New 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
Send Private Message
Posts: 3351
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
New Member Send Private Message
Posts: 0
New Member
Thank you both. It's working as expected now.