Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Capture Selected ListBox Value in ZFC page

I would like to capture the selected value of a ListBox when a user makes a selection in a zfc htm page. I would then like to use that value as a parameter to pass to an aspx page? Can anyone help me out with this? I have seen the previous threads on this but the answers seem to be archived and unavailable. This is on QVS 8.5.

Thanks for the help.

1 Solution

Accepted Solutions
chrisbrain
Valued Contributor

Capture Selected ListBox Value in ZFC page

Hi,

JavaScript along the lines of the following should allow you to inspect a give listbox for the values and associated states of the values. The code might need to be tweaked if your listbox if multi columned but hopefully you get the idea.

<script type='text/javascript'>
function showListBoxValues(lbId)
{
var tblElement = document.getElementById(lbId);
var rows = tblElement.rows;

var res = [];

for(var r = 0; r < rows.length; r++)
{
var td = rows.childNodes[0];

var state = td.className;
var text = td.title;
var value = td.value;

res.push(state + ',' + text + ',' + value);
}

alert(res.join('\n'));

}

</script>
<span onclick='showListBoxValues("LB1468")' >Get Selected Value</span>



4 Replies
chrisbrain
Valued Contributor

Capture Selected ListBox Value in ZFC page

Hi,

JavaScript along the lines of the following should allow you to inspect a give listbox for the values and associated states of the values. The code might need to be tweaked if your listbox if multi columned but hopefully you get the idea.

<script type='text/javascript'>
function showListBoxValues(lbId)
{
var tblElement = document.getElementById(lbId);
var rows = tblElement.rows;

var res = [];

for(var r = 0; r < rows.length; r++)
{
var td = rows.childNodes[0];

var state = td.className;
var text = td.title;
var value = td.value;

res.push(state + ',' + text + ',' + value);
}

alert(res.join('\n'));

}

</script>
<span onclick='showListBoxValues("LB1468")' >Get Selected Value</span>



Not applicable

Capture Selected ListBox Value in ZFC page

Hi Rick

What about

<h4>getfieldselections ( FieldName [, ValueSep [, MaxValues]] ) ? </h4><h4>

This returns a string with the current selections in a field but I am not sure whether it will work in a htm page.

Not applicable

Capture Selected ListBox Value in ZFC page

This is what I was looking for. Now if I can get the state=="AvqSelected" to work properly.

Thanks, Rick

Not applicable

Capture Selected ListBox Value in ZFC page

I was trying to do it on the htm side. I think your solution would be server side.

Thank you for response though.

Community Browser