Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2006, 12:28 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Ajax Select Boxes

I'm not sure what control or interface will best do what I'm looking for and I'm hoping somebody can point me in the right direction.

The problem: I have a database of a huge number of things. I need the user to be able to select from these specific things. But, there are too many to put in a dropdown.

Initially, I was using something like vbulletin does with the name suggest for pms. If you type in the first 3 letters of what you are looking for, a menu popped up from the database with all the options that contained that snippet. The more you typed, the more refined the options became.

BUT, this created a problem because the popup menus obliterate select boxes beneath it in Internet Explorer. Because the stupid form I have to work with is huge, there is no real way to arrange the form so that no ajax field is above a select box.

Ideally, I could put an empty select box on the page. If the user started typing the first 3 letters, the select box would fill with the appropriate options. The problem is that select boxes don't let you type 3 characters. Each character you type sends you to the options that start with that letter.

I thought putting in a textbox and having it change to the selectbox when the options filled would work, but upon reflection it won't because we lose the ability to refine the search and we can't go back and search again if we mess up the first time.

I also considered a text box to type the query in and then fill an adjacent select box with the results of the query, but the form already has too many controls.

Redesigning the form to have less stuff on it is not an option. The client wants all the stuff on one screen. Argh.

So, to summarize, what I need is an intuitive way for the user to create a mechanism to select from a huge list of stuff in the database and enter the selection into a form. Any ideas or links to things you think might work?

Amy
Reply With Quote
  #2  
Old 06-21-2006, 05:04 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What about a pop-up? You'd have a text field with a choose option link next to it. The user would click the link, choose an option from the pop-up, and then the pop-up would auto-close and auto-fill the text field.
Reply With Quote
  #3  
Old 06-21-2006, 06:15 PM
tgreer tgreer is offline
 
Join Date: Oct 2005
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What you want is the missing "combobox" element. HTML doesn't have one. One of the most popular articles on my site experiments with creating one. It works great in FireFox, but IE's z-index bug cannot be avoided.

Thank you for posting this publically - a refreshing change.

I think a CSS-based "popup" DIV, populated with AJAX as a result of typing into a textbox, might be your only choice.
Reply With Quote
  #4  
Old 06-21-2006, 06:38 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and it's the divs that wipe out the select boxes underneath. very frustrating. the code you posted is exactly what I'm looking for, but the darn clients use IE.
Reply With Quote
  #5  
Old 06-21-2006, 06:42 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems you pointed me to the search term I needed. I'm going to play with this, that seems to work in IE

http://shaunwagner.com/projects/js/comboBox.html
Reply With Quote
  #6  
Old 06-21-2006, 06:52 PM
tgreer tgreer is offline
 
Join Date: Oct 2005
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's close... though it has really bad functionality due to focus/blur issues and the keypress handler. It's hard to click again, start over, get focus back to type again. That's why my approach uses a textbox. Note, that the z-index/select element error in IE should be fixed in IE7.

In FF, you stack them, as I've done. In IE, you simply have to find a way to visually marry the two controls. A FieldSet might be nice for this.

How do the DIVs "wipe out" the select boxes? I'm trying and failing to visualize that.
Reply With Quote
  #7  
Old 06-21-2006, 06:59 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I have a form that has a ajax popup div in a table row above a row that has a select box, and I use ajax to bring up the menu and select something, the div renders the selectbox invisible in IE. The only way to get it back is to refresh. I can't show you this in action because it's on an intranet.

It doesn't wipe out textboxes, checkboxes or many other controls. But select boxes disappear.

Some research when I first encountered the problem indicated that the only known workaround was to rearrange the form so that this didn't happen. But, I no loner have that option.
Reply With Quote
  #8  
Old 06-21-2006, 07:04 PM
tgreer tgreer is offline
 
Join Date: Oct 2005
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds like a form of the same error. Though it's horribly old-fashioned and won't work with popup blockers, instead of a DIV, could you use a Window.Open()?

Or, if IE is the problem, you can use browser detection code, and use an IE-only "dialog".
Reply With Quote
  #9  
Old 06-21-2006, 07:20 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I may end up going to window.open as suggested. I am posting some screenshots so you don't think I'm nuts.

The first one is the screen. See the physicians with contacts underneath? Watch what happens to 'Type' after the menu is used.
Attached Images
File Type: gif 1.gif (8.2 KB, 0 views)
File Type: gif 2.gif (11.2 KB, 0 views)
File Type: gif 3.gif (9.1 KB, 0 views)
Reply With Quote
  #10  
Old 06-21-2006, 07:27 PM
tgreer tgreer is offline
 
Join Date: Oct 2005
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's the well known IE bug with z-index and select elements. It's been around for years, and I've been dealing with it in one fashion or another for years. A colleague and I worked out a solution using IFRAMEs, but the memory is fuzzy. A web search on "IE select z-index" should give you enough information on the issue to choke a horse.

The select boxes don't "disappear"... in fact, they are always on top; they show up on top of the DIV. They do so even if you give the DIV a z-index of 999 and the select a z-index of -999. It's a bug in IE.

Of course I think you're nuts, amy - but I sense a ban hovering over my head if I continue.

Edit: Not a ban from you... but from Mr. "You've Been Warned", if I expounded on why I think you're nuts.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:19 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04398 seconds
  • Memory Usage 2,276KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete