PDA

View Full Version : how to remove this error ??



PHPycho
06-29-2007, 09:35 AM
Hello forums!!
I had used the following function(for deleting div elements) and its working properly

function deleteCampaignRow(parentElem, childElem){
var parentObj = document.getElementById(parentElem);
var childObj = document.getElementById(childElem);
parentObj.removeChild(childObj);
}
when the form is submitted , it gives the error "parentObj has no properties".
how to solve the above problem ?
Any Idea ??
Thanks in advance to all of you

Twey
06-29-2007, 11:00 AM
function removeElementById(id) {
var el = document.getElementById(id);
el.parentNode.removeChild(el);
return el;
}