PDA

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



gpazi
05-30-2007, 05: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 1.5.0.11 but not on IE7.

Here's my code:

test.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<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>
<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
***********************************************/
</script>


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

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

smokinjoe
10-18-2007, 05:09 PM
Hi there,

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

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

SmokinJoe

smokinjoe
10-19-2007, 12:17 PM
For anyone with a similar problem the solution is.....

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

SmokinJoe

djr33
10-19-2007, 12:40 PM
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)?

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

feaster
06-30-2008, 01: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">
<option>abc</option>
<option>def</option>
<option>zxv</option>
</select>


To:


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