|
htmlOption
Selection list option class | [Previous] [Main] [Next] |
| htmlMeta encapsultes the <OPTION> tag, and is used to specify an option in a selection list on a form. Selection lists are created using the htmlInputSelect class.
| |
|
| |
| There are three data items associated with each option:
| |
|
|
| |
| When the form containing the selection list is submitted to the server, a name/value pair is sent for each selected option in the list. An option may be pre-selected in the browser using the Select() method.
| |
|
| |
| #include <dcmicro/htmlpp/option.h>
| |
|
| |
|
| |
| htmlInputSelect
| |
|
| |
| #define SELECTED TRUE
| |
| #define NOT_SELECTED FALSE
| |
|
| |
| htmlOption()
| |
| Constructs an empty option object.
| |
|
| |
| htmlOption( | const String& display_content,
| |
| Boolean enable_select = NOT_SELECTED )
| ||
| Constructs an option object for display_content. If enable_select is TRUE, the option will be selected by default on the browser.
| |
|
| |
| htmlOption( | const String& value,
| |
| const String& display_content,
| ||
| Boolean enable_select = NOT_SELECTED )
| ||
| Constructs an option object using
| |
|
| |
| htmlOption( const htmlOption& rhs )
| |
| Copy constructor.
| |
|
| |
| virtual ~htmlOption()
| |
| Destroys the object.
| |
|
| |
| = | htmlOption& operator= ( const htmlOption& rhs )
| |
| Replaces the object contents with rhs, then returns a reference to the object.
| |
|
| |
| Content | htmlOption& Content( const String& display_content )
| |
| Sets the display content of the option to display_content, then returns a reference to the object.
| |
|
| |
| Content | String Content() const
| |
| Returns the display content of the option as a string, or an empty string if not set.
| |
|
| |
| Select | htmlOption& Select( Boolean enable_select = SELECTED )
| |
| Sets the selection state of the option, and returns a reference to the object. If enable_select is TRUE, the option will be pre-selected when displayed by the browser.
| |
|
| |
| IsSelected | Boolean IsSelected() const
| |
| Returns SELECTED (TRUE) if the option is marked as selected, or NOT_SELECTED (FALSE) otherwise.
| |
|
| |
| Value | htmlOption& Value( const String& value )
| |
| Sets the value of the option to value, then returns a reference to the object. Unless a value is specified, the content will be returned to the server when the form is submitted.
| |
|
| |
| Value | String Value() const
| |
| Returns the option value as a string, or an empty string if not set.
| |
|
| |
| void Print( ostream& os ) const
| ||
| Outputs the object to os.
| |
|
| |
| Clone | htmlObject FAR * Clone() const
| |
| Returns a base-class pointer to a deep copy of the object.
| |
|
| |
| See the example in Tutorial:Forms:Selection Lists
| |
