You need to test for NaN before you attempt any arithmetic.
I would never use parseInt, especially without the second argument (which base to covert to), for converting numbers like this, use Math.floor. Try this
Code:
alert(parseInt("012");
alert(parseInt("012", 10);
alert(parseInt("012", 8);
alert(Math.floor("012");
So:
Code:
var seatspassed = (form.txtSeatsLeft.value);
var iSeatsPassed = Math.floor(seatspassed);
if (isNaN(iSeatsPassed))
{
//alert and exit
}
//repeat for seatswanted
--
Joe (
Microsoft MVP - XML)