Checkbox Widget for HTML |
Services Products Contact us |
Karoo Project Docs Index |
|
|||
checkboxHTMLA checkbox is just an input element with type="checkbox". In this case the widget library just makes it conformant to the style of the rest of the widgets. <input type="checkbox" checked="checked"/> <!-- widget checkbox action:myCheckboxAction; --> JavascriptThe "action:myCheckboxAction" in the above example causes a javascript function to be called when the checkbox is toggled. The "action" property specifies the name of the function, in this case: "myCheckboxAction" The function is called, and passed the HTML element that was clicked. E.g. the following Javascript function is called when the example on this page is clicked:
function myCheckboxAction(target)
{
alert("toggled "+elementToString(target)+"\n checked="+target.checked);
}
(The elementToString function is a convenience function supplied with the widget library for debugging purposes). There is also a Javascript function mechanism for setting the checked state of the checkbox, E.g. (assuming that the "elem" variable was assigned to the checkbox: elem.checked = false; CSSAt present, the checkbox widget does not use any special CSS class. In future, we plan to use other HTML elements (than just input) to create a checkbox, and then, special CSS classes will apply. More... |
||||
|
Zwartberg Reseach & Development is a registered trading name of Open Source Software Consulting CC. |