wcCheckboxList( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Creates a set of HTML check boxes.

Example

wcCheckboxList(cntrlHandle, "select last_name from customers",
                "last", "ALIGN=Top", "Smith", &buf);

Syntax

int wcCheckboxList(void *controlHandle,
                     char *select,
                     char *name,
                     char *attributes,
                     char *defaultSelection,
                     char **buffer)
controlHandleThe handle to the control structure.
selectThe query that retrieves the items to be displayed in the group of check boxes. Use SQL SELECT syntax. One check box is created for each row retrieved by the SELECT. If you retrieve one column, the INPUT tags for the check boxes use the following pattern:
<INPUT TYPE=checkbox NAME=name [attributes] VALUE=column>
If you select two columns, the INPUT tags for the check boxes use the following pattern:
<INPUT TYPE=checkbox NAME=name [attributes] VALUE=column1>column2
nameA value to be used in the NAME attribute of the HTML <INPUT> tags that are generated by wcCheckboxList( ).
attributesSettings for the other attributes of the HTML <INPUT> tags that are generated by wcCheckboxList( ). For more information about the attributes, refer to your HTML documentation.
defaultSelectionThe box that is checked when the HTML page is displayed, providing the user with a default selection. If this parameter is NULL, no default selection is provided.
bufferA storage area where you can keep the HTML output from the wcCheckboxList( ) function. Use this parameter to store the HTML so you can examine or manipulate it. If this parameter is NULL, the HTML output is returned directly into the output HTML page.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Tips

Program Example

The following code shows how wcCheckboxList( ) is used in an application.

/* Declare the event handling function */
int nameBoxes(controlHandle)
	void *controlHandle;
{
	wcCheckboxList(cntrlHandle, "select last_name from customers", 
		"last", "ALIGN=Top", "Smith", &buf);
}

int requestLoop(controlHandle)
	void *controlHandle;
{
	char *pageText;
	wcConOpen(controlHandle, 0);

	/* Associate nameBoxes( ) with the "CheckBoxes" event */
	wcSetEventHandler(controlHandle, "CheckBoxes", nameBoxes);

	/* Load and explode the AppPage */
	wcLoad(controlHandle, "page", &pageText);
	WebExplode(controlHandle, pageText, NULL);
	wcConClose(controlHandle);
}

The nameBoxes( ) function is called when WebExplode( ) encounters the following tag in the AppPage:

<HTML>
<BODY>
...
<?MIEVENT NAME="CheckBoxes">
...
</HTML>
</BODY>

Related Topics

wcRadioList( )
wcSelectList( )


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home