WebListBox provides property which allows user to get the selected values.
This topic will show you how to get selected values on button click.
To get selected values on button click
- Set selected items on load.
- Add a html button.
- Create GetValues() function to get the selected values.
function GetValues()
{
wlb = ISGetObject("WebListBox1");
for (var i = 0; i < wlb.Values.length; i++)
{
alert(wlb.Values[i]);
}
}
|
- Invoke GetValues() function in button onclick.
<input type="button" id="wlbButton" value="Get Values" onclick="GetValues()"
/>
- Run the project. Click the button to get the selected values.