SetValue Method (HTMLCONTROL)


10.9, PLBCMP GUI Only

 

The SetValue method is used to set the values of HTML form elements such as input, select and textarea contained in a HTMLCONTROL object. The method sets the value attribute in the HTML element that has an id attribute that matches the id parameter. This method uses the following format:

 

[label]

{object}.SetValue

[GIVING {return}] USING [*Id=]{id}:

 

 

[*Value=]{value}[,[*Flags=]{flags}]

 

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.

value

Required. A Character String Variable or literal that has the value string.

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:

  1. This method changes the value attribute value in a HTML element contained in a HTMLCONTROL object.

  2. The ZERO flag is always set TRUE.

  3. The OVER flag is always set FALSE.

  4. 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.

  5. The {flags} parameter is a bitmask value that forces specialized behaviors for the execution of this method.

  6. The {return} value will always be zero.

Example of SetValue Method:

 

For a HTMLCONTROL that contains a HTML element as follows:

 

<input type='text' class='myClass' id='MyEdit' value='Blue' >

 

This PL/B SetValue method sets a value using the following instruction:

 

     HtmlControl.SetValue Using *ID="MyEdit", *Value="Green" 

 

In this example, the new HTML element is updated as follows:

 

<input type='text' class='myClass' id='MyEdit' value='Green' >

 

 

See Also: HTMLCONTROL Method Syntax



PL/B Language Reference