Jump to content

Long selection fields displayed as two lines


mottwsc

Recommended Posts

I'm using PHP to render HTML and have a selection box with long text fields which are a combination of two fields (college name and location).  An example of part of the selection box would be:

Adelphi University - Garden City, NJ

Adirondack Community College - Queensbury, NJ

 

I'm trying to do two things, much like Facebook does them -

 

(1) I would like the first line to say the college and the second (sub-line) the location, as in

Adelphi University

  - Garden City, NJ

Adirondack Community College

  - Queensbury, NJ

 

(2) I'd like to allow users to select on more that just the first letter in the selection box, so if the user typed 'ad', the user would see colleges with 'ad' in the name and/or location (such as the two example colleges); if the user typed 'Queensbury', the user would see all of those colleges that had 'Queensbury' in the name and/or location.

 

I'm assuming this requires JavaScript, but maybe it is something else or a combination of things.  Can someone provide any guidance or point to examples on either or both of these?

 

Thanks!

 

Michael

 

Link to comment
Share on other sites

Sounds like you would have to build somethign from scratch. I can't think of any way to customize a standard select list to do that.

 

You are also making multiple requests. One would be about creating a multi-line select list and second would be a search capability. The fist would be done with a combination of CSS and DHTML, the second could be accomplished with just JavaScript or with AJAX.

 

In any event, you are asking for someone to provide the whole ball of wax. If you want that, then you should post in the freelancing forum and perhaps someone would be willing to do it for compensation.

Link to comment
Share on other sites

In any event, you are asking for someone to provide the whole ball of wax. If you want that, then you should post in the freelancing forum and perhaps someone would be willing to do it for compensation.

 

I'm pretty sure all he typed was:

I'm assuming this requires JavaScript, but maybe it is something else or a combination of things.  Can someone provide any guidance or point to examples on either or both of these?

 

doesn't seem to me like he's asking for any code at all.

 

Here's my input. Do you use firefox? If not get it. If so, download the stumble application. And stumble things web programming-related. I had a bunch bookmarked, but lost the bookmarks(dont ask) but I remember stumbling across tons of ajax websites that give you code for tons of different methods, one of which being the auto-complete facebook-esque thing you're looking for.

Link to comment
Share on other sites

mjdamato - Thanks for your suggestions.  I'm not looking for someone to custom-code this for me.  I am looking for snippets, examples, functions, etc. that others know about that do similar things.  I'd also prefer to be able to do this - if possible - using one thing: JavaScript or Ajax or whatever (less to learn, maintain).  If not, then so be it.

 

dannyb785 - Thanks for the suggestion on web searching.  I'll look into it.  Sounds like AJAX might do the trick.

 

I'm also open to other suggestions, since I'm not set on a particular language outside of PHP.  If I could do it with PHP, that would be great, but I don't think so.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.