Populating user interface items in Javascript


John Clarke
I have a textbox, textarea and select box on my user interface. How can I populate the values using Javascript ?

decsoft

Hello John,

If you refers to AB controls, we can use the value property in both the Text input control and the value property of the Textarea control, and, the items and the value properties in the Select control. Take a look at that help topics and post here if you have some further questions about it.



John Clarke
Hi, I read the description "Runtime. Array of strings variable. The Items control property stores the items that are shown in the control. You can set this variable at designtime using the Array editor dialog or at runtime, like any other array variable." but I find myself still puzzled regarding how to populate the items attribute of the select component with an Array using Javascript.

I know that if I had to do this in HTML I would create an option element which I would then append to the select.

decsoft

Hello John,

Yes; certainly we no need to add "options" into the select: we must deal with the "items" property, so, for example, we can change the items in the select in this way:

Or we can add a new item to the select in this way (remember, "items" is an Array variable):


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.