ebs.generateGenericControl
Generates HTML form controls, such as text fields, text boxes, checkboxes, date selectors, etc.
Syntax
Copy
function ebs.generateGenericControl(attr: IEbsMetadataAttribute, htmlId: string): void;
| Parameter | Type | Description |
|---|---|---|
attr
|
IEbsMetadataAttribute | Type of HTML form control to be created. |
htmlId
|
string | ID of the HTML element where the control will be inserted. |
Type Aliases
Maps available HTML form controls to numeric values.
Copy
{AttributeTypeValue: number}
| Property | Type | Description |
|---|---|---|
| AttributeTypeValue | number |
|
Examples
In this example:
- We set up an event handler for clicking on the subscribeButton button.
- When the button is clicked, a div element on the page with the subscriptionMonths ID is populated with a number field (
AttributeTypeValue: 5). - The field value is set to 6.
Copy
$('#subscribeButton').on('click', function (event) {
ebs.generateGenericControl({AttributeTypeValue: 5}, 'subscriptionMonths');
$("#subscriptionMonths input").val(6);
})