In a form a text box is created dynamically by clicking on add button such that the text box is created in a new row.Now my problem is the validation of text boxes which were created dynamically such that it shows a message if any of text boxes are left empty when form is submitted by clicking submit button.Please help me out.
EDIT
<html>
<head>
<SCRIPT language="javascript">
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "text";
cell1.appendChild(element1);
}
</SCRIPT>
</head>
<body>
<form onSubmit="return validateFormOnSubmit(this)">
<INPUT type="button" value="Add More Symptom " onClick="addRow('dataTable')" />
<TABLE id="dataTable" >
<TR>
<TD >
<INPUT type="text" name="symp[]" />
</TD>
</TR>
</TABLE>
<input type="submit" value="Submit" name="ADD_SUBMIT">
</form>
</body>
</html>
Above is the script to add new textboxes in a new row. Now i require that when submit button is clicked, each text boxes should be validated whether it is empty or not on client side. The entered values in the text box should not disappear and number of empty text boxes should be same.