comboBox onfocus=this.style.backgroundColor = '#FFFFFF' cause click twice.
I have one textbox and one combobox right now. The problem is , i set onfocus for text area and when i click on it, the textbox colour will change. I use the same method for combobox but it turned out that i click 1st time, background colour changed... click 2nd time, then only the combobox list is shown.
Last edited by drumhitz; 09-06-2007 at 05:43 AM.
I'm not sure I understand. What do you mean only the combo box list is shown? Are you saying the text box disappears? Or the color no longer displays?
Sorry to make you confused actually, forget the textbox part. Im using the 'onfocus' for my combobox. I want the effect to be like when I click it, it will change it background colour and list down the menu.
Now my case is when i clicked 1st time, the background colour changed, I need to click 2nd time then only the list is drop down.
Can this be solved? many thanks...
So you're saying on the 1st click the box doesn't drop down? Change the event from onfocus to onclick.
I changed it to onclick but the problem remains. Need to click twice then only the list will drop down and stay still.
onclick=" this.style.borderWidth = '2px'; this.style.backgroundColor = '#FFFFFF' "
I just tested and it works fine here. Only issue I see is that in IE6 the options background doesn't change, just the select box itself. You'll probably have to change the options backgrounds also, for IE
I'm using IE 7 and it still cannot work, need to click twice only the combobox will drop down the list and stay still. If click once , I can notice the list drop down but it immediately turn off and user cannot select the option in it.
I try to use Firefox and the problem is solved. How to settle the problem in IE 7 ? On the other hand, can you show me the java script on how you make the combo box drop down its list?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL