
This interface denotes one choice in a SELECT block.
This element is a block element.
IHTMLOptionElement Methods
| put_selected | get_selected | put_value |
| get_value | put_defaultSelected | get_defaultSelected |
| put_index | get_index | put_text |
| get_text | get_form |
HRESULT put_selected(
VARIANT_BOOL v
);
Indicates whether this item is the default.
This attribute is used to determine whether a value is submitted with the form. If the value of the control matches the default value, the control's value is not submitted. The value is only submitted when the control's value does not match the default value. Therefore, changing this value changes the rule for whether the value is submitted with the form.
The first item is selected by default.
See also get_selected
HRESULT get_selected(
VARIANT_BOOL *p
);
Indicates whether this item is the default.
This attribute is used to determine whether a value is submitted with the form. If the value of the control matches the default value, the control's value is not submitted. The value is only submitted when the control's value does not match the default value. Therefore, changing this value changes the rule for whether the value is submitted with the form.
The first item is selected by default.
See also put_selected
HRESULT put_value(
BSTR v
);
Specifies the value of the given control. The value is submitted to the server as a name/value pair.
| Control type | Description |
| checkbox | The "selected" value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
| file | The value, a file name, typed by the user into the control. Unlike other controls, this value is read-only. |
| hidden | The control submits this value when the form is submitted. |
| OPTION | The "selected" value. The containing list box control submits this value only if the user has selected the option. |
| password | The default value. The control displays this value when it is first created and when the user clicks the reset button. |
| radio | The "selected" value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
| reset | The button label. If not set, the label defaults to "Reset". |
| submit | The button label. If not set, the label defaults to "Submit". |
| text | The default value. The control displays this value when it is first created and when the user clicks the reset button. |
See also get_value
HRESULT get_value(
BSTR *p
);
Retrieves the value of the given control. The value is submitted to the server as a name/value pair.
| Control type | Description |
| checkbox | The "selected" value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
| file | The value, a file name, typed by the user into the control. Unlike other controls, this value is read-only. |
| hidden | The control submits this value when the form is submitted. |
| OPTION | The "selected" value. The containing list box control submits this value only if the user has selected the option. |
| password | The default value. The control displays this value when it is first created and when the user clicks the reset button. |
| radio | The "selected" value. The control submits this value only if the user has selected the control. Otherwise, the control submits no value. |
| reset | The button label. If not set, the label defaults to "Reset". |
| submit | The button label. If not set, the label defaults to "Submit". |
| text | The default value. The control displays this value when it is first created and when the user clicks the reset button. |
See also put_value
HRESULT put_defaultSelected(
VARIANT_BOOL v
);
Specifies whether the option is selected by default.
This value can be changed programmatically but has no effect on the appearance nor on how forms are submitted.
The default value for this property is TRUE.
See also get_defaultSelected
HRESULT get_defaultSelected(
VARIANT_BOOL *p
);
Determines whether the option is selected by default.
This value can be changed programmatically but has no effect on the appearance nor on how forms are submitted.
The default value for this property is TRUE.
See also put_defaultSelected
HRESULT put_index(
LONG v
);
Sets the ordinal position of the option in the list box.
You can assign a value to this property without generating a syntax error, but the value is not stored.
See also get_index
HRESULT get_index(
LONG *p
);
Retrieves the ordinal position of the option in the list box.
You can assign a value to this property without generating a syntax error, but the value is not stored.
See also put_index
HRESULT put_text(
BSTR v
);
Sets the text string specified by the OPTION tag.
Assigning a value to the text property changes the text property internally but does not cause the listed value to change. Submitting the form submits the internally stored value, not the one displayed.
See also get_text
HRESULT get_text(
BSTR *p
);
Retrieves the text string specified by the OPTION tag.
Assigning a value to the text property changes the text property internally but does not cause the listed value to change. Submitting the form submits the internally stored value, not the one displayed.
See also put_text
HRESULT get_form(
IHTMLFormElement **p
);
Retrieves a reference to the form the element is embedded on.
See also IHTMLFormElement
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.