SetAttr Method (HTMLCONTROL)
10.0A, PLBCMP GUI Only
The SetAttr method changes low level HTML element attributes in a HTMLCONTROL object. The method sets the requested data from the HTML element that has an id attribute that matches the id parameter. This method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A HTMLCONTROL that is accessed.
return
Optional. A Numeric Variable that always returns zero.
Id
Required. A Character String Variable or literal that contains the HTML element id attribute.
name
Required. A Character String Variable or literal that identifies the type of data to be changed in the HTML element.
value
Required. A Character String Variable or literal that has the value string applied to the {name} data type.
flags
Optional. A Numeric Variable or decimal value that specifies a bit mask value that controls the behavior of this method.
Flags Affected: OVER, ZERO
Note the following:
This method changes an attribute value in a HTML element contained in a HTMLCONTROL object.
The ZERO flag is always set TRUE.
The OVER flag is always set FALSE.
The {id} is a value that determines the HTML element used for data changes. The {id} string is matched against the id attribute of the HTML element.
The {name} identifies the type of data changed in the HTML element matching the {id} string. Information on HTML element attributes can be found at:
The {name} parameter can be a pre-defined special name or it can be a HTML attribute for the HTML element being accessed.
The pre-defined special name and the HTML attribute names are only used when the current {flags} value is set to zero (0).
|
Special |
Comment |
|
Html |
Html Contents |
|
Text |
Text Contents |
|
Class |
Class attribute |
|
{attr} |
A valid attribute name |
The valid values for the {value} parameter depends on the {name} parameter used.
The {flags} parameter is a bitmask value that forces specialized behaviors for the execution of this method.
The {return} value will always be zero.
Example of SetAttr Method:
For a HTMLCONTROL that contains a HTML element as follows:
This PL/B SetAttr method changes the "maxlength" data value using the following instruction:
In this instruction, the HTML attribute named "maxlength" is changed to "15" in the HTML element with the id attribute of "MyEdit".
See Also: HTMLControl Methods, Method Syntax
![]() |