The form element to modify.
required
attribute (e.g., input, select, textarea).The desired required state. Set to true to make the element required, false to make it optional.
If the provided element is null
, undefined
, or does not support the required
attribute.
MDN Documentation for the required attribute
// Get an input element by its GUID using ix.api.dom.getHtml
const inputElement = ix.api.dom.getHtml("<ELEMENT-GUID>");
// Make the input element required
ix.api.dom.setRequired(inputElement, true);
// Make the input element optional
ix.api.dom.setRequired(inputElement, false);
Modifies the required state of a form element.