SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dammit!

    I posted this wrong again. Sorry folks. This was in reply to "How do I make a form that will calculate values?"

  4. #4
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •