473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Listbox selectindexchange not showing proper index value

I am using visual basic 2017 for a web application, I am using a listbox and I write a code for searching data and if I click on another index item (rather than last search)
listbox selectindexchange not showing last clicked index. my code are like that pleas tell me where I am wrong
Expand|Select|Wrap|Line Numbers
  1. <asp:TextBox ID="TextBox21" runat="server" Onkeyup ="FilterItems(this.value)"  AutoPostBack ="True"
  2.  
  3. function FilterItems(value) {
  4.  
  5. ddl = document.getElementById("<%=ListBox1.ClientID %>");
  6.  
  7.         j1 = 0;
  8.         j = 1;
  9.         ok = 0;
  10.         if (ddl1 != null) 
  11.         {
  12.     for (i = 1; i < ddl1.options.length; i++) {
  13.                 ok = 0;
  14.  
  15.                 if(value.localeCompare((ddl1.options[i].innerHTML.substr(0, value.length))) !== 1) {
  16.                     if (value !== "") {
  17.                         ok = 1;
  18.                         j = i;
  19.  
  20.          ddl1.options[i].scrollIntoView(true);
  21.         ddl1.options[i].selected = true;
  22.         i = ddl1.options.length;
  23.         return false;
  24.  
  25.  
  26.                     }
  27.                 }
  28.             }
  29.          }
  30.            }
Dec 17 '19 #1
0 3424

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: michael | last post by:
Below is a simplified version of table cell mouseover script, running separate from the HTML code, that was posted on this group yesterday: var d=document, td; function mover(){...
3
by: RRT | last post by:
I have an existing table which describes Streets and sections of streets between intersections: Table 1: Streets by Intersections Street Area Ann St. Main to Jackson...
3
by: Chris Thunell | last post by:
I have a Listbox on an vb aspx web page. When i select something in the listbox i do not get a selected value or selected index. The selected index is always -1. Any thoughts would be greatly...
1
by: savvy | last post by:
I'm writing a Search Query in Index Server SQL language. but not able to get the index value of any document in the Index Server. As this code strQuery = "Select Filename,PATH from Scope() where...
5
by: Stan SR | last post by:
Hi, I use a repeater that displays images. I need to add dynamically a jscript function on each image that use the index value of the repeater <asp:Repeater ID="ph" runat="server"...
6
by: mattmao | last post by:
Hi all. There is a challenge question I encountered recently, which says: "In plain English, there are six different ways when you want to tell someone else about the current time: ...
0
by: tedpottel | last post by:
Hi I am trying to right a script to keep a local copy of my mysql database in a local access file. I was able to do this in Access visual basic, but cannot get it to work in python. The...
1
by: Frank Lovejoy | last post by:
I have googled everywhere but cannot find a solution. Hopefully someone can help me here!? By clicking a trigger image, I want to also pass an index value to my object inside my document.write...
1
by: Thenkarai | last post by:
i using vb.net.. in my project How to access toolstripmenuitem using index value..and any object value control the toolstripmenu item thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.