November 30th, 2001, 04:15 PM
November 30th, 2001, 04:24 PM
Try this . .
Go to this link and do a find in the page for "validation". There are MANY examples of how to do it from dates, to characters, to email addresses. Takes a minute to load, but well worth it as a reference and to "code reuse". ;-) It's free.
November 30th, 2001, 04:32 PM
I got the validation working thanks to the link above but would like to expand what it checks for and am having some trouble doing this.
It currently checks the values are within a set range and display particular error messages if not (depending on its too high, too low, or empty). I would also like it to check that the value is actually a number. I tried using isNaN but it's not working.
Also, I would like the calculation to occur ONLY if all the fields pass. I tried using an if statement to check if the function is true (and the validate function returns true or false based on the result) but it doesn't work.
Here are a link to the files
http://tiger.towson.edu/~tbaldw2/loan_calculator/LoanCalc1.js (with the non-working changes)