Classes

Method Html3():checkBox() Professional

Create HTML code for a checkbox.

Syntax
:checkbox( <cName>        , ;
           [<cValue>]     , ;
           [<cCaption>]   , ;
           [<cOptions>] ) --> NIL
Parameters
<cName>
The parameter <cName> becomes the value of the nameattribute.
<cValue>
The optional parameter <cValue> becomes the value of the valueattribute.
<cCaption>
The optional parameter <cCaption> becomes the value of the captionattribute.
<cOptions>
The optional parameter <cOptions> is a character string that is inserted into the HTML <input> tag.
Return

The return value of the method :checkBox() is always NIL.

Description

The method creates the HTML code for a checkbox. The parameter <cValue> is the string returned from oHTML:getVar(<cName>) if the checkbox is checked. When it is not checked, oHTML:getVar(<cName>)returns the value NIL. <cValue> defaults to "on". To create a checkbox in checked state, pass the character string "checked" as fourth parameter.

A call to this method must be enclosed by the method calls :formStart()and :formEnd()

HTML output:

   <input type=checkbox name="cName" value="[cValue]" [cOptions]>[cCaption] 

PRG example:

IF FIELD->LOGIC 
   oHTML:checkbox( "LOGIC", , "Check here!", "checked" ) 
ELSE 
   oHTML:checkbox( "LOGIC", , "Check here!" ) 
ENDIF 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.