Hi! I don't know anything about javascript and I am using following function to add dynamic feilds in my form.
Problem is I want to restrict the number of rows it is inserting.Like 3 rows.
The code is:
HTML Code:
<script language="javascript">
function addRow(tableID) {
	var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
   		 for(var i=0; i<colCount; i++) {
                 var newcell = row.insertCell(i);
                 newcell.innerHTML = table.rows[0].cells[i].innerHTML;
                 //alert(newcell.childNodes);
                 switch(newcell.childNodes[0].type) {
                    case "text":
                            newcell.childNodes[0].value = "";
                            break;
                    case "checkbox":
                            newcell.childNodes[0].checked = false;
                            break;
                    case "select-one":
                            newcell.childNodes[0].selectedIndex = 0;
                            break;
                }
            }
        }
 
</script>
Please help me in this regard.