OpenMRS/openmrs-module-htmlformentry — pull request #27 by stephenlorenz (2012-07-28 16:09:35+00:00)
Title: Html 66

See https://tickets.openmrs.org/browse/HTML-66.

Snippet for the wiki if branch is accepted into master:

HTML-66 introduces the toggle attribute for checkbox style fields. With the toggle attribute you can specify whether or not a span or div on the page is visible or disabled depending on whether a checkbox is checked or not. The toggle attribute accepts two syntaxes. The basic syntax simply accepts the DOM id of the target div or span. For example:

What color is your hat?

The more advanced syntax accepts a JSON structure with the attributes: id and style. For example:

What color is your hat?

The "id" attribute is the DOM id of target div/span that you wish to hide or disable. The "style" attribute accepts either "hide" (default) or "dim". The "hide" style completely hides the target div/span until the checkbox is checked. The "dim" style greys-out and disables the child components of the target div/span until the checkbox is checked.