Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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>
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
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>
This is what I was looking for. Now if I can get the state=="AvqSelected" to work properly.
Thanks, Rick
I was trying to do it on the htm side. I think your solution would be server side.
Thank you for response though.