PDA

View Full Version : Fill in the blank in numeric



apple
September 7th, 2003, 11:46 PM
Hello, i'm doing a new mathematic fill in the blank quiz application and the details are as below.

Example:
When i type in any answer like 0015, 015, 15.0, 15.00 should be acceptable and absolute to 15. So, what should i do??

Thanks.

kode
September 7th, 2003, 11:49 PM
Surely you didn't set the radix parameter.
var ans = parseInt(Inp.text, 10);

apple
September 8th, 2003, 01:12 AM
kode, thanks for the code. I have used the parseFloat fuction as the answer to be accepted could also in floating number.

Once again, kode thanks you for all your help!!

kode
September 8th, 2003, 01:43 AM
I totally forgot about the parseFloat function!! :P
For the record, the code I posted works fine too. :)