You also can use some HTML5 attributes, some browsers might already take advantage of them (type="number" min="0"
).
Whatever you do, remember to re-check your inputs on the server side: you can never assume the client-side validation has been performed.