JavaScript
$sa Function
Syntax
$sa(element, attribute, value)
Arguments
- elementelement objectstringarray
A string with the ID or NAME of the element, a pointer to an HTML element, or an array of either of the previous.
- attributestringarray
A string or array of strings containing the attributes to set for the element(s).
- valuestringarray
A string or array of strings containing the values to assign the attributes specified in attribute.
Description
The $sa() function sets an attribute or multiple attributes for a single element or multiple elements.
Discussion
Behavior of arrays of elements or attributes is much the same as with the $ga() function.
Example
/*Set the value of the user-defined 'fieldIsDirty' attribute.*/ $sa('firstname','fieldIsDirty','yes') /*Set the 'fieldIsDirty' attribute for multiple elements.*/ $sa(['firstname','lastname','company','address','city','state','zip'],'fieldIsDirty','no'); /*Set multiple attributes for an element. 'attribute1' is set to 'value_of_attribute1' and 'attribute2' is set to 'value_of_attribute2'.*/ $sa('input1',['attribute1','attribute2'],['value_of_attribute1','value_of_attribute2']);
Use {dialog.object}.getPointer() to get the DOM element for a control.
See Also