I'm planning on making a form that a user can put values into text boxes, and through advanced formulas will produce a series of results. Would I use CGI or Javascript for this? Are there any examples of this kind of form that you could show me? Thanks.
I did a calculator once in JavaScript that worked really well. Unfortunately that code is long gone. It was much, much simpler than what you want to do. But, JavaScript should work pretty well. I built a form with input and output fields. Then I wrote functions to do the calculations, and then I called the functions on button clicks. The great thing about it was that it was clent side and fast.
I recently wrote a BIG calculator in JavaScript that calculates values for about 30 fields based on user input of four different fields. Unfortunately I can't post the code since it's really the property of my employer.
But I would recommend JavaScript. The results are immediate. You don't even need a form button. Simply clicking anywhere outside the field you've just entered a value for can trigger the function to calculate the other field's values. And with JavaScript, you save the server from doing any of the work. Why not let it calculate client-side?
You'll need to get very familiar with the JavaScript Math Object. It can do anything you need to do as far as calculations go.
Bookmarks