If you have a field that is numeric, then you can simply -0 from the string value to return a numeric value, eg.
[CODE]var twix = document.getElementById("twix").value-0;[?CODE]
in the HTML side of things, you can limit the number of character that the field will accept to 2 characters. You could attach a script to run on change to check that any character input is a number 0-99 as well.
All the code you need is on developer.com and only needs searching for.
If your post falls off the page, bump it. ...
Please remember to wrap any code you have in forum tags:-
[CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]
If you can't think outside the box, you will be trapped forever with no escape...