Checkbox (Bootstrap): Difference between revisions
Jump to navigation
Jump to search
Created page with "file:Bscheckbox.png == Description == Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. By settin..." |
No edit summary |
||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
The Checkbox allows users to select a binary option from a list of one or more items. | |||
[[Introduction_to_Bootstrap#Popovers_and_Tooltips|Popovers and Tooltips]] are supported. | |||
== Properties and Methods == | == Properties and Methods == | ||
Line 12: | Line 12: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | | badge || Adds a Badge to the alert. Design Time and Runtime. | ||
|- | |- | ||
| | | footer || An optional message at the bottom of the list of items. Design Time and Runtime. | ||
|- | |- | ||
| | | header || An optional message at the bottom of the list of items. Design Time and Runtime. | ||
|- | |- | ||
| | | icon || An optional [http://getbootstrap.com/components/#glyphicons icon] to appear at the top of the list. Design Time and Runtime. | ||
|- | |||
| inline || Display items horizontally? Design Time. | |||
|- | |||
| items || Items to show, one per line. Prefix * for disabled, > for selected, ! for heading (not all controls support headings). Design Time. | |||
|- | |||
| length || Items to show, one per line. Prefix * for disabled, > for selected, ! for heading (not all controls support headings). Design Time. | |||
|} | |} | ||
Line 26: | Line 32: | ||
== Example (Basic) == | == Example (Basic) == | ||
Go through all the checkboxes and see which ones have been chosen. | |||
<pre> | <pre> | ||
Function | Function Checkbox1_onclick() | ||
Dim choices = "Choices: " | |||
For i = 0 To Checkbox1.length-1 | |||
If Checkbox1.getValue(i) Then choices = choices & i & " " | |||
Next | |||
MsgBox choices | |||
End Function | End Function | ||
</pre> | </pre> | ||
== Example (JavaScript) == | == Example (JavaScript) == | ||
Go through all the checkboxes and see which ones have been chosen. | |||
<pre> | <pre> | ||
Checkbox1.onclick = function() { | |||
NSB.MsgBox( | var choices = "Choices: "; | ||
}; | for (i = 0; i <= Checkbox1.length - 1; i++) { | ||
</pre> | if (Checkbox1.getValue(i)) { | ||
choices = choices + i + " "; | |||
} | |||
} | |||
NSB.MsgBox(choices); | |||
};</pre> | |||
== Output == | == Output == |
Revision as of 21:21, 2 June 2016
Description
The Checkbox allows users to select a binary option from a list of one or more items.
Popovers and Tooltips are supported.
Properties and Methods
Standard properties are supported, plus:
badge | Adds a Badge to the alert. Design Time and Runtime. |
footer | An optional message at the bottom of the list of items. Design Time and Runtime. |
header | An optional message at the bottom of the list of items. Design Time and Runtime. |
icon | An optional icon to appear at the top of the list. Design Time and Runtime. |
inline | Display items horizontally? Design Time. |
items | Items to show, one per line. Prefix * for disabled, > for selected, ! for heading (not all controls support headings). Design Time. |
length | Items to show, one per line. Prefix * for disabled, > for selected, ! for heading (not all controls support headings). Design Time. |
Events
Standard events are supported. For this control, the onclick event will be most useful.
Example (Basic)
Go through all the checkboxes and see which ones have been chosen.
Function Checkbox1_onclick() Dim choices = "Choices: " For i = 0 To Checkbox1.length-1 If Checkbox1.getValue(i) Then choices = choices & i & " " Next MsgBox choices End Function
Example (JavaScript)
Go through all the checkboxes and see which ones have been chosen.
Checkbox1.onclick = function() { var choices = "Choices: "; for (i = 0; i <= Checkbox1.length - 1; i++) { if (Checkbox1.getValue(i)) { choices = choices + i + " "; } } NSB.MsgBox(choices); };