I am new at Javascript and I wanted to know if there is a way to check if textfield input contains anything other than numbers.
I know how to do that in Java, but Ja
Yup - just standard regex on the string:
var str = 'mystring 123'; if(str.match(/[^0-9]/)) { ... }
If you need to know how to get the string from the element:
var str = document.getElementById('myId').value;