Bottom Line Up Front
Is there a CSS way to solve this? Or will I have to hack this jquery plugin I'm using to move the dynamic dropdown div to the OUTSIDE of the form, do a position:absolute, and move it back up in the form?
(hmmm this 'tags' field at stackoverflow looks like JUST what I need :-)
EDIT Fixed page example to validate. Sorry, should have done this before submitting question.
EDIT 20 July: removing fieldset CSS for z-index:0 solves it for FireFox. I tested out http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -- which appends the DIV to the end of the html BODY, which works cross browser.
Background
Simple form with a couple fieldsets w/legends. CSS is nothing fancy:
label { float:left; width: 150px; }
input { float: left; width: 132px; }
fieldset { position:relative; }
Note that means, in the HTML, I do a BR-tag w/a clear:left after each input tag.
--> The form looks nice, alls is well.
Driving goal
But, 1 field in the middle has WAY too much data (i.e., all the main US patent classifications codes). Therefore, this needs to be a LOT more usable. I'm thinking ... autocomplete ... save matches, so a text field that "tokenizes" the matches ... etc.
Perfect, this is a common enough need. So, I slap on a jquery plugin for a tokenizing, multiselecting, text-field plugin. There are only a few that do multiple selects, with autocomplete. Pick any one of them. I've tried them all :-)
All tend to do a $(input).insertAfter() of some HTML snippet -- typically a which gets filled via Javascript to contain a UI/LI list.
--> Still good, no wackiness yet.
Problem
Oh my god -- legends, fieldsets, checkboxes, EVERYTHING weaves itself in & over top the dropdown div/ul contents. This is NOT an IE z-index problem.
- position:absolute mashes this up and won't drop nicely like a nav menu, tooltip, css popup or such typically does
- position:relative stops it mashing up, but ... well ... its relative now. So, the container fieldset stretches down, etc.
- firebug, mucking with z-index/position, etc on the CSS just won't solve this.
Do I have to hack the plugin to insert the DIV dropdown snippet outside of the form? (then position:absolute;z-index:999; top/left move up back into the form) Or ... is there a CSS solution?
References:
- Screenshot (with highlighting CSS) of the CRUNCH mixed legend, checkboxes, fieldset and drop-down div at http://www.flickr.com/photos/turnerscraft/3733488100/
- Jquery Tokenizing AutoComplete Text plugin http://loopj.com/2009/04/25/jquery-plugin-tokenizing-autocomplete-text-entry/
- Relative Positioning can work, but thats not a solution. See http://test.iplookout.com/search/