I have a Javascript function, which changes a text field of a form into
a select field. Following is the function
function changeStateFiel d()
{
var myForm = document.getEle mentsByTagName( "form")[0];
alert(myForm.st ateId.value);
myForm.removeCh ild(myForm.stat eId);
var stateSelect = document.create Element("select ");
stateSelect.set Attribute("stat eId2", "stateId");
myForm.insertBe fore(stateSelec t, myForm.countyId );
}
Function displays the correct value in alert. but on line 3
myForm.removeCh ild(myForm.stat eId);
it gives following error. I am using Firefox.
Error: uncaught exception: [Exception... "Node was not found" code:
"8" nsresult: "0x80530008 (NS_ERROR_DOM_N OT_FOUND_ERR)" location:
"http://localhost:8080/APP/premiseCatalog. do Line: 245"]
Your help will be greately appreciated.
Regards,
Naeem.