The commands below are in the ‘Main’ start-up routine.
They cause the Label to say “undefined” instead of “true”, and they cause the message box to say “CheckBox value is undefined” instead of “CheckBox value is true”.
*** How can I set, and then read the value of the checkbox correctly?
(I have tried with checkboxes from both Bootstrap 4 and jqWidgets).
Thanks.
CheckBox22.setValue(1,True)
Label2.text = CheckBox22.getValue(1)
NSB.MsgBox "CheckBox value is " & CheckBox22.getValue(1)
as I am not with my pc now, and what I have worked with is radio button, as the theory behind is similar, this only serve as a rough guide
A =0
Function radioButton1_onchange()
A = 47
'my radiobutton is @the last index.
B =a +2
' my first value is 2,you have to set your own value, bear in mind the 1st index is 0
A = radiobutton. value
If (a==undefined) or (a==null) then
If (a==undefined) or (a==null)
Then
'err
A = 47
B =49
Radiobutton1.value=a
Else
' ok
B=47
End if
End if```
Thanks. Replies appreciated.
I used a single-value check box; it was a Bootstap4 check box and so its starting location was zero. I incorrectly thought that it was a jqWidgets check box, and their starting location is not zero but one. The result was that if one sets the value(1) in a Bootstrap4 check box, it will be recorded as “undefined” because I had, in fact, no location (1).