Okay, I did a mistake and blindly copied and pasted a ''code snippet' that is supposed to restrict the user from typing down ANYTHING ELSE other than a number in a Bootstrap input field.
By blindly doing that, i did not really understood how it's supposed to work. Now i need to allow the decimal point, the "." to be typed down and i don't know what i need to change.
Can someone explain the snippet below or provide a resource?
$('#elementXPosition,#elementYPosition,#elementWidth,#elementHeight').keypress(function(e) {
var a = [];
var k = e.which;
for (i = 48; i < 58; i++)
a.push(i);
if (!(a.indexOf(k)>=0))
e.preventDefault();
});