Ich habe eine Tabelle entwickelt, in der Schüler den Betreff-Namen und die Zeichen eingeben müssen. Ich habe Eingabefeld nur für numerische nur von Javascript gemacht, aber ich bin nicht in der Lage, Validierung zu tun, so dass der Schüler nicht 0 als Zeichen eingeben kann.Markierungen sollten nicht Null sein in Eingabefeld
$("#insertbotheli13").click(function() {
$("#tablebotheli13").each(function() {
var tds = '<tr>';
jQuery.each($('tr:last td', this), function() {
tds += '<td>' + $(this).html() + '</td>';
});
tds += '</tr>';
if ($('tbody', this).length > 0) {
$('tbody', this).append(tds);
} else {
$(this).append(tds);
}
});
});
$(".allownumericwithoutdecimal").on("keypress keyup blur",function (event) {
$(this).val($(this).val().replace(/[^\d].+/, ""));
if ((event.which < 48 || event.which > 57)) {
event.preventDefault();
}
});
\t \t
\t \t
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<table id="tablebotheli13" class="table table-striped table-hover">
\t \t \t \t \t \t \t \t <input type="button" class="btn green" value="Add New+" id="insertbotheli13"></input>
<thead>
<tr>
<th>Subject</th>
\t \t <th> Marks</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" class="form-control subject1" name="subject1">
</td>
\t \t \t <td>
<input type="text" class="form-control marks1 allownumericwithoutdecimal" name="marks1">
</td>
</tr>
</tbody>
</table>
Verwenden Sie '' – Hemal