/    Sign up×
Community /Pin to ProfileBookmark

Autocomplete multiple fields

I have a project where I have approximately 3000 people on my database, a number which is a growing.

One of my pages is assigning people certain positions in a event, this means entering people into specific fields within a form.

When I post my form I am capturing the ID of each person in each field and saving them into a database.

I’m currently using a jQuery Plug-in over top of a select box to enable searching.

A native Select box is too difficult to use based on the sheer volume of people 3000 people over 30 boxes.

The plug-in improves searching within each box but makes my page slow and clunky.

i’m looking for ways how I can quickly search my list.

Having 3000 rows over 30 boxes makes my page humongous, using Ajax every time makes for a slower experience.

I’m hoping they may be a way of using just one list stored in my page and calling it whenever a user starts typing?

perhaps a text box for user input and a hidden ID box?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumAug 12.2021 — @kiwis80#1635472
>I’m currently using a jQuery Plug-in over top of a select box to enable searching.

Is this jQuery UI's autocomplete? In order to improve performance, you should start searching only when at least three characters have been typed in.

A different approach: Load all 3000 people at page load. Afterwards they will be available locally and need not be fetched by Ajax any more.
Copy linkTweet thisAlerts:
@kiwisauthorAug 12.2021 — @Sempervivum#1635475

no it’s another 3rd party one.

I think a big part of the issue is loading 90,000 <option> rows into my HTML (3,000 people into 30 fields)

Is there a good search autocomplete option, jQuery or native that would pass over the person ID into a hidden field?
Copy linkTweet thisAlerts:
@SempervivumAug 13.2021 — With my second approach I meant: Stick to autocomplete but instead of loading the names on demand load them once at page load into an array and let the plugin get them from this array.

I suspect that switching to a different plugin will not fix the performance issues. Is there a link to the one you are using now?
×

Success!

Help @kiwis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...