473,385 Members | 1,907 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,385 software developers and data experts.

combox not showing same records every time

I have a combobox on this testsite: sneleopard.dk/combobox.html
it should show all records containing the search string while typing.
But sometimes it only shows some of them, why?
1) type "spi" and it shows among others "spinat helbladet"
2) delete the search string and type "bla"
3) it should now among others show "spinat helbladet" again, but it
doesnt, why?

maybe its because that the function shows first records starting with
the search string, and thereafter those containing?

Mar 3 '07 #1
4 1243
On Sat, 03 Mar 2007 07:54:00 +0100, hygum <th*********@gmail.comwrote:
I have a combobox on this testsite: sneleopard.dk/combobox.html
it should show all records containing the search string while typing.
But sometimes it only shows some of them, why?
1) type "spi" and it shows among others "spinat helbladet"
2) delete the search string and type "bla"
3) it should now among others show "spinat helbladet" again, but it
doesnt, why?

maybe its because that the function shows first records starting with
the search string, and thereafter those containing?
It's a problem with the commas. Try it with "baby" or "frisk": you won't
find "spinat, baby, frisk".

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 3 '07 #2
On 3 Mar., 08:27, OmegaJunior <omegajun...@spamremove.home.nlwrote:
On Sat, 03 Mar 2007 07:54:00 +0100, hygum <thomashy...@gmail.comwrote:
I have a combobox on this testsite: sneleopard.dk/combobox.html
it should show all records containing the search string while typing.
But sometimes it only shows some of them, why?
1) type "spi" and it shows among others "spinat helbladet"
2) delete the search string and type "bla"
3) it should now among others show "spinat helbladet" again, but it
doesnt, why?
maybe its because that the function shows first records starting with
the search string, and thereafter those containing?

It's a problem with the commas. Try it with "baby" or "frisk": you won't
find "spinat, baby, frisk".

--
Using Opera's revolutionary e-mail client:http://www.opera.com/mail/
yes I do. With baby or frisk i find that record. The commas are
escaped in the javascript array. But still it can be a comma
problem... I will try without

Mar 3 '07 #3
On Mar 3, 8:54 am, "hygum" <thomashy...@gmail.comwrote:
I have a combobox on this testsite: sneleopard.dk/combobox.html
it should show all records containing the search string while typing.
But sometimes it only shows some of them, why?
1) type "spi" and it shows among others "spinat helbladet"
2) delete the search string and type "bla"
3) it should now among others show "spinat helbladet" again, but it
doesnt, why?
I changed your function, so that the array search is done once in one
loop only and it gives me none of the problems above.

Expand|Select|Wrap|Line Numbers
  1. for(i = 0; i < functionListLength; i++)
  2. {
  3. if( ( functionlist[i].search(re1) >= 0 ) ||
  4. ( functionlist[i].search(re2) >= 0 ) )
  5. {
  6. selectObj[numShown] = new Option(functionlist[i],comboids[i]);
  7. numShown++;
  8. }
  9. }
  10.  
You will have to clean up the variables not used, like
"visteelementer".

In my opinion you can leave out the first criteria (first search) as
the second criteria will find also those who starts with the search
string!

Best wishes,
John, Latvia

Mar 5 '07 #4
On 5 Mar., 11:17, "j.andersen" <j.andersen...@gmail.comwrote:
On Mar 3, 8:54 am, "hygum" <thomashy...@gmail.comwrote:
I have a combobox on this testsite: sneleopard.dk/combobox.html
it should show all records containing the search string while typing.
But sometimes it only shows some of them, why?
1) type "spi" and it shows among others "spinat helbladet"
2) delete the search string and type "bla"
3) it should now among others show "spinat helbladet" again, but it
doesnt, why?

I changed your function, so that the array search is done once in one
loop only and it gives me none of the problems above.

Expand|Select|Wrap|Line Numbers
  1. for(i = 0; i < functionListLength; i++)
  2. {
  3.    if( ( functionlist[i].search(re1) >= 0 ) ||
  4. ( functionlist[i].search(re2) >= 0 ) )
  5.    {
  6.       selectObj[numShown] = new Option(functionlist[i],comboids[i]);
  7.       numShown++;
  8.    }}
  9.  

You will have to clean up the variables not used, like
"visteelementer".

In my opinion you can leave out the first criteria (first search) as
the second criteria will find also those who starts with the search
string!

Best wishes,
John, Latvia
i know the second search find the same as the first (but not the
reverse), but thats because i want the list to be first the records
that begins with the search string, and thereafter the records that
contains.

Thanks for your help

Mar 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jorge Godoy | last post by:
Hi. I have created an interface where I have a QDataBrowser and all of its editing and navigating controls and one of the displayed controls is in a QSpinBox. I have the navigation from...
2
by: maddman | last post by:
I have an odd problem with my database, and was hoping someone could point me at the problem. We have an access database that is used by several people to input data. Users have reported some...
3
by: Alpha | last post by:
This is a Window based application. How do I get my combox listing to display in sorted order by DataMember? I inserted a blank row to the dataset table which is the datasrouce for the comboBox...
5
by: Greg McKnight | last post by:
This may be the second time this post is showing, I accidentally shut down my browser. Sorry if it is a repeat. I am a newbie to VB.net, so please forgive me if these are simple questions. ...
2
by: Bob | last post by:
The scenario is that of the employees table wherein there's an EmployeeId and a ReportsTo field in the same table. The combobox is one in a datagrid view that lets you select an employee from the...
2
by: Timbo | last post by:
Hi there, I’m not used to working in VB and I think this situation calls for excactly that. I use Access 97 SR-2. My first table is a table containing all the Tickets I got. The field ”Ticket”...
11
by: radink | last post by:
Hey All, I have a report that I would like to show a word on based on if a field is checked in a form. For example. The form has a check box called Fee. If that is checked, I want the word Paid...
1
by: aaron5150 | last post by:
OK so here goes. I have created a table for my "employees details" including "employee number". I have also completed another table which shows orders by "employee number", details of order etc. ...
4
by: Thomas Arthur Seidel | last post by:
Hello to all, I have a small or big problem with a customer data base, where during a change of system we might have created duplicate records. This should be easy to find, you might think, but,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.