I have used array to get the input values of each row in html. The code is
<input type="text" name="source[]" id="source'+row'">
I need to remove the elements from the array when i remove the a row.
var source=document.getElementsByName("source");
Array.prototype.forEach.call( source, function( node,index ) {
if(index==id){
node.parentNode.removeChild( node );
}
});
when I console the result, the child is removed. But when I submit the form using PHP, the array has empty values.
`['24','','',56]`
How to remove the empty values.