Advertisement

08.23.2007 at 08:37AM PDT, ID: 22782563
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Repaint Issue with Dynamic Options in Dropdown Selects

Asked by grav0005 in Safari Web Browser, JavaScript

Tags: , , , ,

Hi everybody,

I am having a problem in Safari 3 running on Windows 2000.  I can't say if this behaviour is the same in previous browser versions or on other operating systems, but it is consistently occurring under the circumstances that I previously described.  The problem is very simple:  When you add Options to a dropdown select element ( using JavaScript ), after having already viewed the items, the list will resize accordingly, but the new area will be all black!

Below is the web page code.  It explains how to reproduce the bug.  I noticed that it does not happen with multi-line selects ( size is greater than 1 ).  I experimented with switching the size up and back down again to force a refresh but that was unsatisfactory.  I have posted the bug on the Safari bug page, but if anyone can suggest a fairly easy workaround for the time being, I would be very grateful.

Thanks,

Rob G

Code follows:

<html>
<head>
<title>Repaint Issue with Dynamic Options in Dropdown Selects</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<div align="center">
  <h2>Repaint Issue with Dynamic Options in Dropdown Selects</h2>
</div>
<h3 align="center">In Safari 3.0.3 (522.15.5) running on Windows 2000 </h3>
<p><b>Instructions:</b></p>
<ol>
  <li>Click on the list to open it.</li>
  <li>Click the button, which will add more options.</li>
  <li>Click on the list again to view the items. There will be black all around
    the previous options.</li>
</ol>

<p>Email me at rob@robgravelle.com for more information or to suggest possible solutions.</p>
<h3 align="left">
  <p>&nbsp;</p>
  <script language="JavaScript">
  var btnClicked = false;

function addOptions( list )
{
      for (var i=list.options.length; i<10; i++)
      {
            list.options[i] = new Option("New Item " + i, "");
      }
}


</script>
</h3>
<form name="form1" method="post" action="">
  <p align="center">
    <select name="select">
      <option>item 1</option>
      <option>item 2</option>
      <option>item 3</option>
    </select>
  </p>
  <br>
  <br>
  <br>
  <br>
  <p align="center">
    <input type="button" name="Button" onclick="addOptions(this.form.select);" value="Button">
  </p>
</form>
<h3 align="center">&nbsp;</h3>
  </body>
</html>Start Free Trial
 
Keywords: Repaint Issue with Dynamic Options in …
 
Loading Advertisement...
 
[+][-]08.23.2007 at 11:28AM PDT, ID: 19756628

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Safari Web Browser, JavaScript
Tags: javascript, safari, repaint, option, dynamic
Sign Up Now!
Solution Provided By: ChetOS82
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.23.2007 at 11:38AM PDT, ID: 19756691

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628