2

I have a form using multiple <cfinput type="datefield" ...>. They are positioned in such a way that the pop-up CSS calendar should appear over the field for others. However, the text fields for the other dates end up in front of the calendar.

This is only an IE issue as Firefox and Safari work just fine.

Is there a simple CSS hack or some other simple thing I can do to get the calendar to act as it should? Re-arranging the form is not very helpful.

Patrick McElhaney
  • 57,901
  • 40
  • 134
  • 167
ale
  • 6,369
  • 7
  • 55
  • 65

4 Answers4

4

Well, you have to encapsulate your datefield wirhin a div with both position:relative and Z-index value, as in :

<div style="position:relative; z-index:3">
<cfinput type="dateField" name="info_dateDebutPub" value="#dateformat(info_dateDebutPub,'dd/mm/yy')#" mask="dd/mm/yy">
</div>

Defining Z-index within the Cfinput will not work.

1

IE6 has issues with z-index and some kinds of controls. Try this: http://brandonaaron.net/jquery/plugins/bgiframe/docs/

Light
  • 144
  • 1
  • 5
0

Try this in your CSS,

for DIV with cfinput fields

position:relative;z-index:0

for Calendar

position:absolute;z-index:1
kayteen
  • 777
  • 1
  • 8
  • 22
0

My first inclination is to attempt to add a style for the text fields with a negative z-index. Alternately, you could attempt to apply a positive z-index to the popup.

The first would probably be easier, given the way that the popups are written dynamically -- CF passes any unrecognized or unused attributes through to the browser, so you could just add a style. Something like:

<cfinput type="datefiled" name="bob" value="" style="z-index: -1;">

Not tested, YYMV.

Ben Doom
  • 7,865
  • 1
  • 27
  • 30
  • 3
    Z-index is only meaningful on positioned elements, on it's own it has no effect. – Tomalak Oct 20 '08 at 08:06
  • @Tomalak, I was fairly certain that the popups, if not the text fields, were positioned. @Al Everett, sorry it did not work. I should have said that the popups should have a positive z-index. I don't know if you tried that. – Ben Doom Oct 23 '08 at 14:24
  • The elements generated most certainly do have a positive z-index. Over 9000, in fact. – ale Oct 24 '08 at 14:33