Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Subject: RE: Adding and deleting options from select box on load


Message #1 by "Louis LAFRUIT" <louis.lafruit@p...> on Sat, 1 Feb 2003 17:26:28 +0100
Hi Chris,
You might try DHTML instructions:

myElement=document.createElement("option"); instead of  myElement = new
Option(...);
*****
	with (mySelect)
	{
		while (children.length>0){
			myElement=lastChild;			// or children.item(0);
			removeChild(myElement);
		}
	}

  instead of  mySelect.optiond[0]=null;
*******
and

mySelect.appendChild(myElement);  instead of  mySelects.options[optionElem]
= myElement;
****
Please keep me informed of your experience because removing and adding
options seems to function erraticly.

My program sometimes works perfectly, at other times produces an unnamed
error to transmit to Microsoft and instructs me to restart the computer if
the phenomena repeats itself!!!

Good luck,
Louis



  Return to Index