A word of caution, DON'T take parseInt for granted. It has been mentioned in answers before but I will elaborate it a bit more:
Here is short but more detailed definition of parseInt:
The parseInt(string, radix) function parses a string and returns an integer.
The radix parameter (as an integer number) is used to specify which numeral system to be used (ex. binary, ternary, octal, decimal, hexadecimal etc).
If the radix parameter is omitted, JavaScript assumes the following:
- If the string begins with "0x", the radix is 16 (hexadecimal)
- If the string begins with "0", the radix is 8 (octal). This feature is
deprecated If the string begins with any other value, the radix is 10
(decimal)
Only the first number in the string is returned!
If the first character cannot be converted to a number, parseInt() returns NaN. If, however, it can, it will return a number. Sometimes this is not what you expected!
Older browsers will result in parseInt("010") as 8, because of older versions of ECMAScript, (older than ECMAScript 5, uses the octal radix (8) as default when the string begins with "0". As of ECMAScript 5, the default is the decimal radix (10).
So in short - make sure you the parameter you are passing is sterilized as base 10 decimal number (I think you don't wanna 12,3 as your width) or even better make sure it is in your condition like:
if ( !isNan(form.with.value) && parseInt(form.width.value, 10) > 0 )