Change bootstrap checkbox to true at runtime


#1

I guess it’s quite simple, but…

why can’t I set a bootstrap checkbox to true at runtime?

i’ve tried
Checkbox1.setValue(1,True)
and
Checkbox1.setValue(1) = True

but at least attempt 1 says:
Uncaught TypeError: Checkbox1.setValue is not a function.
line 2 column 11


#2

@suseday

Just Checkbox1.setValue(0);
or Checkbox1.setValue(1); ?

Bernd


#3

nope. that doesn’t work. try the sample with that code…


#4

I added a button to the bootstrap/checkbox sample and the code looks like that:

Function Button1_onclick()
Checkbox1.setValue(0,True)
End Function

If you have only one checkbox its number is 0


#5

thank you guys for taking time. Yes, that works. But I am quite sure that I testet that also! I am confused… But now I can’t say why it didn’t work before. It might be that I put that code not in a function. I tried and the code works only inside a function.

anyway. Thanks alot!

Btw. the wiki should be edited. I’ll try to get an account to edit.


#6

I tried it with the sample and it did work. I made checkbox1 unchecked by Checkbox1.setValue(0);

Bernd