I had a look at the code and tried it out, it works for me (though I did get rid of those "..." things you have. I was using firefox.
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 65
Skill Endorsements: 0
> I get an error message every so often with this code.
> 'document.getElementById(...)' is null or not an object.
Because there exists no element with the given ID. It looks as though the ID for your form elements are dynamically generated and hence the intermittent problem. A better way for setting the default drop down option would be to grab hold of all the SELECT items and set their selectedIndex property to zero (except for the SELECT element under consideration)
var sels = document.getElementsByTagName("SELECT");
for(var i = 0, maxI = sels.length; i < maxI; ++i) {
var sel = sels[i];
if(sel == slctFild)
continue; // exclude the current select element
sel.selectedIndex = 0;
}
~s.o.s~
Failure as a human
12,220 posts since Jun 2006
Reputation Points: 3,307
Solved Threads: 783
Skill Endorsements: 55
You just dumped huge compacted code portion to the forum. Sorry, I am not going to sit down and look at it. Also, please do not hijack other's thread. You should create your own.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17
Learn any JS library.
It will practically save you alot of pain with javascript ;)
Stefano Mtangoo
Senior Poster
3,731 posts since Jun 2007
Reputation Points: 462
Solved Threads: 396
Skill Endorsements: 0
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17