Click here to Skip to main content
15,902,846 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: search list box Pin
Brij17-Feb-10 2:50
mentorBrij17-Feb-10 2:50 
GeneralRe: search list box Pin
Laxmi R17-Feb-10 3:50
Laxmi R17-Feb-10 3:50 
AnswerRe: search list box Pin
AdilSaud17-Feb-10 3:37
AdilSaud17-Feb-10 3:37 
GeneralRe: search list box Pin
Laxmi R17-Feb-10 3:55
Laxmi R17-Feb-10 3:55 
GeneralRe: search list box Pin
AdilSaud17-Feb-10 20:39
AdilSaud17-Feb-10 20:39 
GeneralRe: search list box Pin
Laxmi R17-Feb-10 23:01
Laxmi R17-Feb-10 23:01 
GeneralRe: search list box Pin
AdilSaud17-Feb-10 23:06
AdilSaud17-Feb-10 23:06 
GeneralRe: search list box Pin
AdilSaud19-Feb-10 1:16
AdilSaud19-Feb-10 1:16 
Hi Laxmi,

Please find the updated code of incremental search to display result in a div tag.

JavaScript function :
---------------------
function searchOptions(selectboxID, searchText){
var selectbox = document.getElementById(selectboxID);
var i;
var divResult = document.getElementById('divResult');
var searchResult = '';
var opt;
for(i=0;i<selectbox.options.length-1;i++){
if (selectbox.options[i].text.indexOf(searchText) &gt;= 0) {
searchResult = searchResult + selectbox.options[i].text + "<br>";
}
}
divResult.innerHTML = '';
divResult.innerHTML = searchResult;
}

HTML Code :
-----------

<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>

<asp:ListBox ID="lstTest" runat="server" >
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>

<asp:ListBox ID="lstTest" runat="server" >
<asp:ListItem Text="Adil"></asp:ListItem>
<asp:ListItem Text="ab"></asp:ListItem>
<asp:ListItem Text="abc"></asp:ListItem>
<asp:ListItem Text="abcd"></asp:ListItem>
<asp:ListItem Text="abcde"></asp:ListItem>
<asp:ListItem Text="abcdef"></asp:ListItem>
<asp:ListItem Text="abcdefg"></asp:ListItem>
</asp:ListBox>


<div id="divResult"></div>

Hope Now you get the the solution.

Pls let me know if you need any further information on the same.

Thanx,
Adil...Smile | :) )
Questionhow to add dynamically content in iframe javascript Pin
Tridip Bhattacharjee17-Feb-10 2:01
professionalTridip Bhattacharjee17-Feb-10 2:01 
AnswerRe: how to add dynamically content in iframe javascript Pin
Anurag Gandhi17-Feb-10 4:50
professionalAnurag Gandhi17-Feb-10 4:50 
Questioncrossbrowser center div with dynamic text Pin
Tridip Bhattacharjee17-Feb-10 2:01
professionalTridip Bhattacharjee17-Feb-10 2:01 
AnswerRe: crossbrowser center div with dynamic text Pin
Brij17-Feb-10 2:44
mentorBrij17-Feb-10 2:44 
AnswerRe: crossbrowser center div with dynamic text Pin
Anurag Gandhi17-Feb-10 4:53
professionalAnurag Gandhi17-Feb-10 4:53 
Questionmultiple file download in asp.net. Pin
Tridip Bhattacharjee17-Feb-10 2:00
professionalTridip Bhattacharjee17-Feb-10 2:00 
AnswerRe: multiple file download in asp.net. Pin
Anurag Gandhi17-Feb-10 4:56
professionalAnurag Gandhi17-Feb-10 4:56 
Questionconnect to the correct DB Pin
arkiboys17-Feb-10 1:23
arkiboys17-Feb-10 1:23 
AnswerRe: connect to the correct DB Pin
Pranay Rana17-Feb-10 1:30
professionalPranay Rana17-Feb-10 1:30 
GeneralRe: connect to the correct DB Pin
arkiboys17-Feb-10 1:45
arkiboys17-Feb-10 1:45 
GeneralRe: connect to the correct DB Pin
Pranay Rana17-Feb-10 1:54
professionalPranay Rana17-Feb-10 1:54 
AnswerRe: connect to the correct DB Pin
Dinesh Mani17-Feb-10 1:38
Dinesh Mani17-Feb-10 1:38 
GeneralRe: connect to the correct DB Pin
arkiboys17-Feb-10 1:47
arkiboys17-Feb-10 1:47 
GeneralRe: connect to the correct DB Pin
Dinesh Mani17-Feb-10 1:53
Dinesh Mani17-Feb-10 1:53 
AnswerRe: connect to the correct DB Pin
Brij17-Feb-10 1:53
mentorBrij17-Feb-10 1:53 
AnswerRe: connect to the correct DB Pin
mylogics17-Feb-10 19:26
professionalmylogics17-Feb-10 19:26 
Questionfragment caching problem Pin
Amit Spadez17-Feb-10 1:18
professionalAmit Spadez17-Feb-10 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.