Busted Mug

A blog that documents solutions to the most frustrating problems that occur during development in technologies such as Java, XML, AJAX, SQL, CSS and others that make me want to throw my coffee mug against the cube wall.

Thursday, November 30, 2006

Select Boxes - clear all options - except the last one

Update:I was a blithering idiot when I posted this. Read this post. If you're messing with dynamic select boxes here's a good reference. I ran into a problem. Apparently you can't remove the last option (makes sense - how can you have no options?). To make the select appear blank you end up doing something like this:
if (this.selectedDates.length == 0) document.getElementById(this.listName).options[0] = new Option("","");
It just inserts a blank option.


At 3:34 AM, Blogger Sid L said...


Useful information. Very well explained. Thanks for sharing.



Post a Comment

<< Home