SetHTML Method (HTMLCONTROL)


10.9, PLBCMP GUI Only

 

The SetHTML method changes the inner HTML of a HTML element contained in a HTMLCONTROL object. The method schanges the inner HTML of a HTML element that has an id attribute that matches the id parameter. This method uses the following format:

 

[label]

{object}.SetHTML

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

 

 

[*Html=]{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 a valid HTML 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 inner HTML 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 valid values for the {value} parameter can be any valid HTML data.

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

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

Example of SetHTML Method:

 

For a HTMLCONTROL that contains a HTML element as follows:

 

<div id=MyDiv'><p>Hello</p></div>

 

This PL/B SetHTML method changes the inner HTML value using the following instruction:

 

     HtmlControl.SetHTML Using *ID="MyDiv",*Html="<b>Bye</b>" 

 

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

 

<div id=MyDiv'><b>Bye</b></div>

 

 

See Also: HTMLCONTROL Method Syntax



PL/B Language Reference