473,782 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox flickers when adding an Option to Select element

I add some option items to a <selectbox by:

-----
MySelect.length = null; // clears all options in select element

for ( var i in Somename )

{

MySelect.option s[MySelect.option s.length] = new Option(Somename[i],
i,"True"); // appends new options

}

Firefox flickers when the items get added. IE doesn't.

Is there a way to avoid the flickering in firefox? This is anoying if you
update the select elemnt from times to times ajaxively.

Ragards

R4DIUM


Mar 11 '08 #1
1 2496
On Mar 11, 6:19 pm, "Axel Gallus" <u...@rz.uni-karlsruhe.dewro te:
I add some option items to a <selectbox by:

-----
MySelect.length = null; // clears all options in select element

for ( var i in Somename )

{

MySelect.option s[MySelect.option s.length] = new Option(Somename[i],
i,"True"); // appends new options

}

Firefox flickers when the items get added. IE doesn't.

Is there a way to avoid the flickering in firefox? This is anoying if you
update the select elemnt from times to times ajaxively.

Ragards

R4DIUM
I'll just throw out an idea (~hack) here.

Have you tried having two select boxes, one shown and one hidden?

1) Add an item to the hidden box.
2) Display hidden box (which should be on top of or behind the
previously shown one).
3) Hide the first box.
4) Add the same item to the now hidden box.

Of course, you'll need extra logic to know which one the user is
selecting from when submitting the form.

Just an idea.

Cheers,

-Tom Woz
Mar 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2479
by: R. Rajesh Jeba Anbiah | last post by:
In IE, I could be able to directly refer the "id", but it isn't possible in Firefox. Somewhere I read the solution is to refer the id like document.getElementById("month") in Firefox. If I do so, the script works well in Firefox, but IE throws error. (I have added the code snippet below). So, my question is: is there anyway to make the script work in all browser *without* any browser fix ie, without adding any browser detection check?...
4
8640
by: Michael Schuerig | last post by:
I'm trying to change the options of a select element by setting its innerHTML. Here's a demo case: <html> <head> <script language="javascript" type="text/javascript"> function addOpts() { var s = document.getElementById("s"); s.innerHTML = '<option>Opt1</option><option>Opt2</option>'; }
3
9275
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to work on FireFox or Netscape. What could be wrong? The function: function setActiveTab(tabNo) {
4
7922
by: beenamore | last post by:
Hi, I have two select lists and depending on the value selected in the first select dropdown, I want to populate the second list. I tired a couple of different ways, but for some reason, it works fine on IE but not on Firefox. On Firefox the second dropdown list doesnt get populated. Any pointers on how to populate the second dropdown..
3
1928
by: patrickkellogg | last post by:
I have this code when you click the buttom is suppose to add a job history. it works with firefox, opera, but not ie. (please note - new entries don't have all the elements in them yet, but enough to get the idea). Here is the code: ----------------------------------------------------------------- <html>
11
2814
by: davecph | last post by:
I'm constructing a website with a layout created with div-tags. They have a fixed width, float left, and display inline. When one of the div's contain a select-element the right-most div floats down for no apparent reason, but when the select-elements are gone they all align as expected. No css apply to the select-elements. image of prob.: http://sdc.novasol.com/site/nov/TMP/withSelectBoxes.gif image of expected:...
1
4872
by: CMani | last post by:
Hi, I have an select element which has hidden attribute for each of item. Say Employee Id are listed in List Box, the Name and gender are kept in value and ATTRIB respectively for each code in the list box . I want to display the Code, Name and gender of the selected Employee, so i wrote on change event for the select element and invoke the javascript to populate the values to the corresponding input text box. The Html Code is ...
4
5367
by: Patrick Nolan | last post by:
I am using javascript to manipulate optgroups in select elements. When the results are displayed in Firefox 2.0 there is an annoying blank line at the top of the multi-line select box. This doesn't happen with IE7. There's a little program below which illustrates the problem. I create two multi-line select boxes. The first one has an optgroup and an option specified in the HTML. That one displays with "opt1" as the first line. The...
5
1761
tjc0ol
by: tjc0ol | last post by:
Hi all, I made contact page which allows visitors to input their name, email address, phone number, comments and select a comment type by using <select> element in html with javascript. Among the option of it are: General Support, Technical Support, Sales in billing, Request RA no. and Others. If they select Others there will be a pop-up textbox for others(so they can specify a comment type) and the textbox is placed on a DIV. I placed CSS on...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9942
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.