setAttributes(propertyName: String; attributeName: String; attributeValue: String): Boolean;
The setAttributes method of the JadeHTMLClass class allows additional attributes to be set on an input tag prior to the HTML generation.
This method returns true if the property specified in the propertyName parameter exists or it returns false if it does not. For example, if you want to change the color of a SUBMIT button (name=okButton) dependent on a condition, you could code the following.
if customer.specialCustomer then setAttributes('okButton', 'style', "background-color:Red"; else setAttributes('okButton', 'style', "background-color:Blue"; endif;
If the original HTML for this was <input type=submit name="okButton" value="OK">, the generated HTML code for this would be as follows (assuming the condition to be true).
<input type=submit name="okButton" value="OK" style="background-color:Red">
The style command can be ignored in Web browsers that do not fully support Cascading Style Sheets.
The parameters for the setAttributes method are listed in the following table.
Parameter | Description |
---|---|
propertyName | Name of the property whose attributes are to be set |
attributeName | Name of the attribute to set |
attributeValue | Value of the attribute |