IHTMLInputFileElement

IHTMLInputFileElement


This interface specifies a form input control.

IHTMLInputFileElement Methods
get_type   put_name   get_name  
put_status   get_status   put_disabled  
get_disabled   get_form   put_size  
get_size   put_maxLength   get_maxLength  
select   put_onchange   get_onchange  
put_onselect   get_onselect   put_value  
get_value  

IHTMLInputFileElement::get_type

HRESULT get_type(
    BSTR *p
);

Retrieves the type of intrinsic control represented by the given element object.

p
Address of a variable that receives the intrinsic-control type. The possible values depend on the element as listed in the following table.

Element Possible value Description
INPUT checkbox Used for simple Boolean attributes or for attributes that can take multiple values at the same time. It is represented by a number of check box fields, each of which has the same name. Each selected check box generates a separate name/value pair in the submitted data, even if this results in duplicate names. The default value for check boxes is on.
file A file upload element.
hidden No field is presented to the user, but the content of the field is sent with the submitted form. This value can be used to transmit state information about client/server interaction.
image An image field that you can click, causing the form to be immediately submitted. The coordinates of the selected point are measured in pixel units from the upper-left corner of the image, and are returned (along with the other contents of the form) in two name/value pairs. The x-coordinate is submitted under the name of the field with .x appended, and the y-coordinate is submitted under the name of the field with .y appended. Any value property is ignored. The image itself is specified by the SRC attribute, exactly as for the Image element.
password Same as the TEXT attribute, except that text is not displayed as the user enters it.
radio Used for attributes that accept a single value from a set of alternatives. Each radio-button field in the group should be given the same name. Only the selected radio button in the group generates a name/value pair in the submitted data. Radio buttons require an explicit value property.
reset reset is a button that when clicked resets the form's fields to their specified initial values. The label to be displayed on the button can be specified just as for the submit button.
submit submit is a button that when clicked submits the form. You can use the value attribute to provide a non-editable label to be displayed on the button. The default label is application-specific. If a submit button is clicked to submit the form, and that button has a name attribute specified, that button contributes a name/value pair to the submitted data. Otherwise, a submit button makes no contribution to the submitted data.
text Used for a single-line text-entry field. Use in conjunction with the size and maxLength properties.
SELECT select-multiple Specifies a multiple-select list box.
select-one Specifies a single-select list box.
TEXTAREA textarea Used for multiple-line text-entry fields. Use in conjunction with the size and maxLength properties.

IHTMLInputFileElement::put_name

HRESULT put_name(
    BSTR v
);

Sets the name of the control, bookmark, or application.

v
String specifying the name.

The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.

JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.

See also get_name

IHTMLInputFileElement::get_name

HRESULT get_name(
    BSTR *p
);

Retrieves the name of the control, bookmark, or application.

p
Address of a variable that receives the name.

The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.

JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.

See also put_name

IHTMLInputFileElement::put_status

HRESULT put_status(
    VARIANT v
);

Sets the status of the INPUT file control.

v
String or value specifying the status.

See also get_status

IHTMLInputFileElement::get_status

HRESULT get_status(
    VARIANT *p
);

Retrieves the status of the INPUT file control.

v
Address of a variable that receives the status.

See also put_status

IHTMLInputFileElement::put_disabled

HRESULT put_disabled(
    VARIANT_BOOL v
);

Enables or disables the INPUT file control. A disabled control appears dimmed and does not respond to user input.

v
Boolean value specifying whether to disable the control. If TRUE, the control is disabled; otherwise, it is enabled.

The default value for this property is FALSE.

See also get_disabled

IHTMLInputFileElement::get_disabled

HRESULT get_disabled(
    VARIANT_BOOL *p
);

Determines whether the INPUT file control is enabled or disabled.

p
Address of a variable that receives TRUE if the control is disabled, or FALSE otherwise.

The default value for this property is FALSE.

See also put_disabled

IHTMLInputFileElement::get_form

HRESULT get_form(
    IHTMLFormElement **p
);

Retrieves a reference to the form the element is embedded on.

p
Address of a variable that receives an interface pointer to the form element. This parameter receives NULL if the element is not on a form.

See also IHTMLFormElement

IHTMLInputFileElement::put_size

HRESULT put_size(
    long v
);

Sets the size of the control.

v
Value specifying the size, in characters.

See also get_size

IHTMLInputFileElement::get_size

HRESULT get_size(
    long *p
);

Retrieves the size of the control.

p
Address of a variable that receives the size, in characters.

See also put_size

IHTMLInputFileElement::put_maxLength

HRESULT put_maxLength(
    long v
);

Sets the maximum number of characters that can be entered into the control.

v
Value specifying the length.

This can be larger than the size of the control. When this occurs, the control scrolls accordingly as the user types. The default is there is no limit.

See also get_maxLength

IHTMLInputFileElement::get_maxLength

HRESULT get_maxLength(
    long *p
);

Retrieves the maximum number of characters that can be entered into the control.

p
Address of a variable that receives the maximum number of characters.

This can be larger than the size of the textbox. When this occurs, the textbox should scroll accordingly as the user types. The default is there is no limit.

See also put_maxLength

IHTMLInputFileElement::select

HRESULT select(
    void
);

Highlights the input area of the INPUT file control.

You can use the select method with the focus method to highlight a field and position the cursor for a user response.

IHTMLInputFileElement::put_onchange

HRESULT put_onchange(
    VARIANT v
);

Sets the inline script associated with the onchange event for an INPUT type=file element. An onchange event occurs when the content of the object has changed.

v
VARIANT structure that contains the new script.

See also get_onchange

IHTMLInputFileElement::get_onchange

HRESULT get_onchange(
    VARIANT *p
);

Retrieves the inline script associated with the onchange event for an INPUT type=file element. An onchange event occurs when the content of the object has changed.

p
Address of a VARIANT structure that receives the script.

See also put_onchange

IHTMLInputFileElement::put_onselect

HRESULT put_onselect(
    VARIANT v
);

Sets the inline script associated with the onselect event for an INPUT type=file element. An onselect event occurs at the beginning of a user-initiated select. This event can be canceled, and it participates in the bubbling model.

v
VARIANT structure that contains the new script.

See also get_onselect

IHTMLInputFileElement::get_onselect

HRESULT get_onselect(
    VARIANT *p
);

Retrieves the inline script associated with the onselect event for an INPUT type=file element. An onselect event occurs at the beginning of a user-initiated select. This event can be canceled, and it participates in the bubbling model.

p
Address of a VARIANT structure that receives the script.

See also put_onselect

IHTMLInputFileElement::put_value

HRESULT put_value(
    BSTR v
);

Sets the value of the INPUT file control.

v
String specifying the value.

See also get_value

IHTMLInputFileElement::get_value

HRESULT get_value(
    BSTR *p
);

Retrieves the value of the INPUT file control.

p
Address of a variable that receives the value.

See also put_value

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.