c# - How to validate a column in an editable datatable? -




am using editable html datatable on asp.net web page .which this, enter image description here

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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -