View Full Version : DHTML window widget - problem selecting "select" options in firefox

05-30-2007, 04:44 PM
1) DHTML dynamic window

2) http://www.dynamicdrive.com/dynamici...ndow/index.htm

I've posted it as a question at the help forum, but decided it is probabaly a bug, so I'm posting also here.
I'm using the dynamic window with ajax.
The window content includes a select element. Only the first 20 elements can be selected. scrolling down the options, and selecting for example the first SEEN option, will result with selecting the first option in the list (in oppose to the first option seen after scrolling down).
The problem occurs on FireFox but not on IE7.

Here's my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- DHTML windows -->
<link rel="stylesheet" href="src_3rdParty/client/windowfiles/dhtmlwindow.css" type="text/css" />
<script language="Javascript" type="text/javascript">
function openWindow()
// create the path for registerPage.php
var path = location.href;
var index = path.indexOf("test.php");
path = path.substr(0,index)+"windowBox.php";
var dynamicWindow = dhtmlwindow.open('windowBox', 'ajax', path, 'dynamic window', 'width=650px,height=400px,center=1,resize=0,scrolling=0');
return false;

<script type="text/javascript" src="src_3rdParty/client/windowfiles/dhtmlwindow.js">
* DHTML Window Widget- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code

<!-- end of DHTML windows -->
<button onClick="openWindow();" >open window</button>

window content - windowBox.php:
echo '<select name="BirthYear" size="1"></br>';
for ($i =1900; $i<2006;$i++)
echo '<option value = "' . $i .'">'.$i.'</option></br>';
echo '</select>';

10-18-2007, 04:09 PM
Hi there,

I'm experiencing the exact same problem. A little troublesome.

Did you get a resolution/work around to the problem?


10-19-2007, 11:17 AM
For anyone with a similar problem the solution is.....

.... upgrade Firefox to version 3!!! Grab a nightly build until the GA for that.


10-19-2007, 11:40 AM
The script should be compatible with FF2. Upgrading the browser only fixes for you, not your visitors.

Is this a problem with the script in the first place or only in the specific implementation on your site(s)?

In other words, does the same problem occur if you use the demo page (altered to have a longer dropdown, as needed)?

04-17-2008, 03:20 AM
I have also same problem with dynamic window.
Only the first 20 options in select element can be selected when using FF2.

06-30-2008, 12:18 PM
I found the same problem. It looks like a Firefox 2 problem because Firefox 3 and IE doesn't have any problems with it.

I don't know when is happens exactly ,but i found it only happens when you set some (css) class as attribute.

A possible solution can be is to is add the class(es) after generating the selectbox. Then the problem doesn't occur anymore

The example is an ugly one, but you can do this on a better (cleaner) way. This is only for example.

So change:

<select name="aName" id="aName" class="selectbox">


<select name="aName" id="aName">
<script language="text/javascript>
document.getElementById('aName').className = 'selectbox';