Solved

IE6 -CSS -SELECTBOX problem-coldfusion

Posted on 2009-05-13
12
650 Views
Last Modified: 2012-05-06
Hello experts.
I have downloaded from:
http://www.dhtmlgoodies.com/index.html?whichScript=modal-message
the files for the tutorial from that site:
http://www.dhtmlgoodies.com/scripts/modal-message/demo-modal-message.html
The problem i have is that when i have a select box then it appears over the message and not under.(the known problem with select boxes and IE6).
How can i solve this?
Is there another tutorial that is working for IE6 without problems?
I send the test page.
You can download the scripts from the links.
(i use coldfusion)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<HTML>

<HEAD>

	<title>Demo 1: DHTML modal dialog box</title>

	

	<link rel="stylesheet" href="css/demos.css" media="screen" type="text/css">

	<style type="text/css">

	/* CSS for the demo. CSS needed for the scripts are loaded dynamically by the scripts */

	#mainContainer{

		width:500px;

		margin:0 auto;

		margin-top:10px;

		border:1px double #000;

		padding:5px;

		

	}

	

	/* Alternative layout for the message box - used by one of the messages */

	

	.modalDialog_contentDiv_error{

		border:3px solid #FFF;	

		padding:2px;

		z-index:100;/* Always needed	*/

		position:absolute;	/* Always needed	*/

		background-color:#F00;	/* White background color for the message */

		color:#FFF;

	}

	.modalDialog_contentDiv_error a{

		color:#FFF;

	}

	h1{

		margin-top:0px;

	}

 

	</style>	

	<script type="text/javascript">

	function verify(ver){

		

		if(ver){

			// Confirmed message, i.e. clicked on "Yes"

			alert('Message confirmed');

		}else{

			// Clicked on "No"

			alert('Message not confirmed');

		}

	}

	</script>

	<link rel="stylesheet" href="css/modal-message.css" type="text/css">

	<script type="text/javascript" src="js/ajax.js"></script>

	<script type="text/javascript" src="js/modal-message.js"></script>

	<script type="text/javascript" src="js/ajax-dynamic-content.js"></script>

</head>

<body>

	<form>

	<div id="header">

		<img src="/images/heading3.gif">

	</div>	

	<div id="mainContainer">

		<p>This is a demo of the DHTML_modalMessage class. It displays a message at the center of the screen and disables all other page controls until the message is closed.</p>

		<a href="#" onclick="displayMessage('includes/demo-modal-message-1.inc');return false">Message from url (example 1)</a><br> 

		<a href="#" onclick="displayMessage('includes/demo-modal-message-2.inc');return false">Message from url (example 2)</a><br> 

		<a href="#" onclick="displayMessage('includes/demo-modal-message-3.inc');return false">Alternative confirm dialog (example 3)</a><br> 

		<p>The content of the two boxes above are loaded from external files. We have also specified that we want a drop shadow on them</p>

		<a href="#" onclick="displayStaticMessage('<h1>Static message</h1><p>This is a static message</p><p><a href=\'#\' onclick=\'closeMessage();return false\'>Close</a>',false);return false">Static message (Example 1)</a><br>

		<a href="#" onclick="displayStaticMessage('<h1>Error message</h1><p>This is a static message with a different layout(css class)</p><p><a href=\'#\' onclick=\'closeMessage();return false\'>Close</a>','modalDialog_contentDiv_error');return false">Static message (Example 2 - different layout)</a>

		<p>These last boxes are displaying static HTML. There are no shadows on these boxes. The last message box is assigned to a different CSS class than 

		the other messages. This gives it a different look.</p>

		<div class="clear"></div>	

	</div>

	</form>

<form name="form1" method="post" action="">

  <label>

    <select name="select" id="select">

    </select>

  </label>

</form>

<script type="text/javascript">

messageObj = new DHTML_modalMessage();	// We only create one object of this class

messageObj.setShadowOffset(5);	// Large shadow

 

 

function displayMessage(url)

{

	

	messageObj.setSource(url);

	messageObj.setCssClassMessageBox(false);

	messageObj.setSize(400,200);

	messageObj.setShadowDivVisible(true);	// Enable shadow for these boxes

	messageObj.display();

}

 

function displayStaticMessage(messageContent,cssClass)

{

	messageObj.setHtmlContent(messageContent);

	messageObj.setSize(300,150);

	messageObj.setCssClassMessageBox(cssClass);

	messageObj.setSource(false);	// no html source since we want to use a static message here.

	messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	

	messageObj.display();

	

	

}

 

function closeMessage()

{

	messageObj.close();	

}

 

 

</script>

</body>

</html>

Open in new window

0
Comment
Question by:Panos
  • 6
  • 5
12 Comments
 
LVL 5

Accepted Solution

by:
sscotti earned 300 total points
Comment Utility
If you don't mind hiding the select box form when you pop the window you could add this code:

<form name="form1" id="form1" method="post" action="">
  <label>
    <select name="select" id="select">
    </select>
  </label>
</form>
<script type="text/javascript">
messageObj = new DHTML_modalMessage();  // We only create one object of this class
messageObj.setShadowOffset(5);  // Large shadow
 
 
function displayMessage(url)
{
       
        messageObj.setSource(url);
        messageObj.setCssClassMessageBox(false);
        messageObj.setSize(400,200);
        messageObj.setShadowDivVisible(true);   // Enable shadow for these boxes
        messageObj.display();
            document.getElementById('form1').style.visibility = 'hidden';
}
 
function displayStaticMessage(messageContent,cssClass)
{
        messageObj.setHtmlContent(messageContent);
        messageObj.setSize(300,150);
        messageObj.setCssClassMessageBox(cssClass);
        messageObj.setSource(false);    // no html source since we want to use a static message here.
        messageObj.setShadowDivVisible(false);  // Disable shadow for these boxes      
        messageObj.display();
       
       
}
 
function closeMessage()
{
        messageObj.close();
      document.getElementById('form1').style.display = 'visible';    
}
0
 
LVL 5

Assisted Solution

by:sscotti
sscotti earned 300 total points
Comment Utility
Sorry, the closeMessage() function should be:

function closeMessage()
{
        messageObj.close();
      document.getElementById('form1').style.visibility = 'visible';    
}
0
 
LVL 9

Assisted Solution

by:ftaco96
ftaco96 earned 200 total points
Comment Utility
dojo is a really good soloution. My team uses dojo tooltips, which have no problem with IE 6 select boxes.

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_Dialog.html
0
 
LVL 2

Author Comment

by:Panos
Comment Utility
Hi.
As i was checking out the solutions the only way is to hide the select boxes or the forms where there are in.The dojotoolkit is hidding the selectboxes only in ie6 and in f.f it is working without problems.
0
 
LVL 2

Author Comment

by:Panos
Comment Utility
Before i close the question please a little more help from sscotti:
How can i use the script i posted in FF and IE7.... and the solution you posted in IE6 with if...?
0
 
LVL 5

Expert Comment

by:sscotti
Comment Utility
I have a little trouble testing in IE6.  I have a Mac and use Parallels for Windows.  However, it does work in IE6, IE7 in Parallels and in FF on the Mac for me.  It is on my server at http://sscotti.com/modal-message/test.html if you want to try it there.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:Panos
Comment Utility
Hi sscotti.
I know.It is working for me too.As i said it is hiddind the form.
The last question was if i could use the code without the hidding function(the first code i posted in the question) when a client has FF or IE7 ,and the code you posted for client with IE 6.Is this possible?
0
 
LVL 5

Expert Comment

by:sscotti
Comment Utility
Not sure I understand.  If it works for all browsers why not just use it.  If there is some other reason you could check the browser agent using javascript and conditionally execute the code to hide the select list if the browser agent is IE6.  
0
 
LVL 2

Author Comment

by:Panos
Comment Utility
Because i'm using these in a search form with many many select boxes it is not so good.It is like the half page in backround is disappearing.
So i prefer that what you said: conditionally execute the code to hide the select list if the browser agent is IE6.
If you want you can answer here or i have to make a new question.
0
 
LVL 5

Expert Comment

by:sscotti
Comment Utility
0
 
LVL 2

Author Comment

by:Panos
Comment Utility
Thank you
0
 
LVL 2

Author Closing Comment

by:Panos
Comment Utility
Thank you all for your help
regards
Panos
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now