c# - How to validate a column in an editable datatable? -
am using editable html datatable on asp.net web page .which this,
how add validation on column target, receive float values.?
function (for enable edit):
function editrow(otable, nrow) { var adata = otable.fngetdata(nrow); var jqtds = $('>td', nrow); jqtds[0].innerhtml = adata[0]; jqtds[1].innerhtml = adata[1]; jqtds[2].innerhtml = '<input type="text" id="float" class="form-control" value="' + adata[2] + '">'; jqtds[3].innerhtml = '<a class="save-row" href="">save</a>'; jqtds[4].innerhtml = '<a class="cancel-row" href="">cancel</a>'; }
i tried add keypress event on textbox , not working.!
$('#float').keypress(function (event) { if ((event.which != 46 || $(this).val().indexof('.') != -1) && (event.which < 48 || event.which > 57) && (event.which != 8)) { event.preventdefault(); } });
am new jquery please me solve ?
wiki
Comments
Post a Comment