How can I validate a table that change dynamically?
I have rules assigned to input in a cell and each row is added run-time.
May I use validation input as a class, or I have to assign an unique ID to each input?
I wish to have something like this:
<head>
<script type="text/ecmascript">
$(document).ready(function () {
$('#testForm').jqxValidator({ rules: [
{ input: '.type1', message: 'Error 1', action: 'keyup', rule: 'minLength=4' },
{ input: '.type2', message: 'Error 2', action: 'keyup', rule: 'Required' },
{ input: '.type3', message: 'Error 2', action: 'keyup', rule: 'email' }
], theme: 'artic'
});
});
</script>
</head>
<body>
<form id="testForm" action="./">
<table>
<tr>
<td>
<input class="type1" type="text" />
</td>
<td>
<input class="type2" type="text" />
</td>
<td>
<input class="type3" type="text" />
</td>
</tr>
<tr>
<td>
<input class="type1" type="text" />
</td>
<td>
<input class="type2" type="text" />
</td>
<td>
<input class="type3" type="text" />
</td>
</tr>
<tr>
<td>
<input class="type1" type="text" />
</td>
<td>
<input class="type2" type="text" />
</td>
<td>
<input class="type3" type="text" />
</td>
</tr>
</table>
</form>
</body>