This topic is locked

get selected value of (list page with search) lookup in the client before jquery or js API

3/19/2015 2:55:06 AM
PHPRunner General questions
G
Getinet author

Hi all,
As i pointed out on the subject,how to get selected value of (list page with search) lookup in the client before using jquery or js API
When i set up my lookup type normal combobox, using jquery and toying with one of the following lines works fine.Where 'dropdown1' is obviously the id of my lookup control.
//params["txt"] =$('#dropdown1').find('option:selected').val(); //works fine

params["txt"] =$("#dropdown1 option:selected").val(); //works fine
//$("select[id$=dropdown1]").val();

//$('#dropdown1 :selected').text();
//alert($("#dropdown1 option:selected").val()); //should work simlar to below as

alert(params["txt"]);//works fine for dd combobox normal
However when i setup my lookup as other PHPRunner offers to have ,i.e. (list page with search) or list box with free AJAX input etc
doesn't yield what i wanted (the Value of selected), it usually output "undefined" on the test alert popup i set up for testing.

I also tried the followings with no luck.
//var value = document.getElementById('dropdown1').value;//undefinedresult
//var value =document.getElementById('dropdown1').selectedIndex.value;
//var value =document.getElementById('dropdown1').options[document.getElementById('dropdown1').selectedIndex].text;
//var value = document.getElementById('dropdown1').options[document.getElementById('dropdown1').selectedIndex].value;
//alert (value);
I am using phprunner 5.3,if anyone could help me on this please.
Always appreciated this forum community.
Thanks in advance.

Regards.