How to restrict cell input field of a looped row , which accept alphanumeric and special character except . or decimal point?

12 views Asked by At

function test(element)
{        
    var evt =element.value;
    alert(evt);
    var keycode = evt.charCode || evt.keyCode;
    alert(keycode);
    if (keycode  == 46) {
        return false;
    }
}
<input type="text" oninput='test(this)'class= 'form-control'>

I am using on-input tag inside particular input box like below but getting undefined error

<input type="text" oninput='test(this)'class= 'form-control'>

function test(element)
{        
    var evt =element.value;
    alert(evt);
    var keycode = evt.charCode || evt.keyCode;
    alert(keycode);
    if (keycode  == 46) {
        return false;
    }
}

but I am getting undefined value from cell. it is not able to pick decimal value.

I was expecting that it should not load value of decimal in input cell.

0

There are 0 answers