If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Need to make a selectable search box

Hi guys,

This is my first post on a forum here so im new lol,

My basic dilemmna/problem is im trying to make a search box that pulls data from a text file and creates a sort of overlay display. I need this data to be selectable. Basically my text file has a list of names, and i want people to type in any string of letters in the search box and if my text file has a name in their that matches the person's search query itl show up below. I then want people to be able to simply select a name as if it were a basic html input. Im doing this for an e commerce site i run and im just trying to include this in my shopping cart page. If anyone would like a live working example of what i want, reply and i can send u a link.

I'm not trying to get anyone to do this for me, im just hoping someone can point me in the right direction. Please note that know a decentish amount of html/css but i have no knowledge at all of javascript and that my ecommerce site does not support php. It uses a custom language called liquid. I would appreciate any answers that go a bit beyond giving me coding terms i probably dont know

Please note that before you think about adding JavaScript features, think about how you would approach this without JavaScript. It has to work in a basic way at least before you can enhance it. This is called progressive enhancement.

So, first steps are to think about user interaction:

Visitor enters search term into a search field and submits the form.

A new page is loaded (or the same page reloaded) with an overlay and the relevant search results that can be selected (possibly with checkboxes, i. e. it has to be a form again?). Upon selecting the results, visitor submits the form and whatever you are trying to achieve happens.

Canceling the overlay/results thingy reloads the page in its original state.

This can all be done with a server side script and without the need of JS. If that’s achieved then you can enhance that functionality in that a JavaScript autocomplete/autosuggestion feature is added that loads the results in an overlay with AJAX without reloading the page.

Ok so i took a look at that link and i think i would be able to add that autocomplete feature itself , my problem is the source of the info, the link you gave was seperated into several parts , one was "source" which talked about the kind of info you could use,etc.. im still confused on how i would set the source to my simple text file, any insight you could give on that?

ok i see what you mean, unfortunately this will be going on a shopping cart page and i cant have these redirects and stuff, it would be to confusing for a customer, just to clarify il send a link of what im looking for exactly,

if you go to this link: http://http://www.fifacointrader.com...ate-team-coins , when u get there just immediately click the grayish 'add to cart' button , then you will be redirected to the shopping cart, once there click the green button in the checkout section, after that a search text box will apear like the one im looking for, notice if you type something into it like a common name such as john, it will come up with a list of similair names.

That is exactly what im looking for. If you select a name theres no redirect and it works like a normal html input.

There's no redirect with autocomplete. It populates the input field with the value chosen. It's really easy to implement even if you don't have any JavaScript knowledge.

First off how are you getting the list from your text file? What server side language are you coding in? If you already know how to pass the data list to your view from the controller/server than its smooth sailing from there.

Ok see thats my exact problem! I dont know how to pull data from the text file! thats my question haha, all this server side script stuff i clueless bro, ik how to implenent the jquery stuff , but not the text file

hahaha, not that clueless lol, i use html obv and a language called liquid, its a special language that replaces php for some ecommerce sites, actuyally my only problem now is my search input literally has like i think 10,000 possible options and its gona take forever to wrap them in option tags, any shortcuts u know?