Share this Page URL

Chapter 18. More JavaScript Fun > A Mortgage Calculator - Pg. 219

More JavaScript Fun form.payments.value = months; } //--> </SCRIPT> 219 That's a complex chunk of code, to be sure, but luckily you don't have to understand how it works. The only thing you need to make sure of when using this script in another page, is that you use the same names for the form controls that I use in the example mortgage. htm file (which is, of course, on the CD in this book). The Least You Need to Know · Mind your mouseovers. When using mouseovers, keep your images small so that it doesn't take too long for the browser to download the second image. · Premium password protection. If you have strict password needs, ask your web host or a CGI programmer to rustle you up some heavy-duty protection. · Mandatory fields. If you have a field that the user must fill in, make that field mandatory by intercepting the submission using the onSubmit attribute. · Ensuring accurate data. If you want users to enter the correct data into your form, show them the contents of each field before submitting the form. This gives the user a chance to cancel the submission if things don't look right.