You appear to be a bot. Output may be restricted
Description
Create a checkbox input fieldNote: In order to obtain a value when the checkbox is unticked we add a hidden field with a value of off See http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ When the value is set then the checkbox is checked
Usage
icheckbox( $name, $value, $disabled );
Parameters
- $name
- ( string ) required – the name for the checkbox input field
- $value
- ( string ) optional – the value of the checkbox – default NOT checked
- $disabled
- ( mixed ) optional –
Returns
voidSource
File name: oik-bwtrace/libs/bobbforms.phpLines:
1 to 17 of 17
function icheckbox( $name, $value=NULL, $disabled=false ) { $it = ihidden( $name, "0" ); $it .= "<input type=\"checkbox\" "; $it.= "name=\""; $it.= $name; $it.= "\" id=\""; $it.= $name; $it.= '"'; if ( $value && $value != "0" ) { $it.= " checked=\"checked\""; } if ( $disabled ) { $it .= kv( "disabled", "disabled" ); } $it.= "/>"; return $it; }View on GitHub View on Trac