473,461 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3430

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: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.