SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with calculator to work on host server

    I downloaded a JS-operated payment calculator for a site and having some problems with it working on the site's host server. I originally tested it out on a page on my personal site to make sure it worked properly, which it does (http://www.whiteboxerdesign.com/afs/calculator2.htm).

    However, when the code is placed on a page with the actual host, I'm having problems with part of it to work properly (http://advantagefundingsolutions.net...asp?page=8681).

    The problem is with the "Show/Recalculate Amortization Table" function that is in two spots in the calculator. On the test site, it works properly by displaying a table below the calculator. However, on the actual host, the table doesn't display and the button jumps to the home page of the site. The hosting company says the problem is with how the data is retrieved by the JS and not with their server configuration.

    I have two questions: is the response by the host server accurate even though the calculator works properly on other sites (I also tested it on a second server and site and it worked there as well). The second is there a simple fix to how the JavaScript creates the table to get this to work on the site's host server?

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    boggy form

    The server has nothing to do with javascript. Javascript runs client-side.
    The page that doesn't work is not well-formed let alone valid. Try it with the style inside the head tags. ie. not like this
    HTML Code:
    </style>
    <html>
    <head>
    And it might help to have the doctype while you're at it.
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The JavaScript is within the head tag. The closing style tag outside the head you referenced is the CMS-generated CSS. I can't add the doctype, unfortunately. I'm working with a poorly-constructed CMS for the site that I have no control over.

    Anything in the JavaScript jump out that could be tweaked? One thing I did notice is that when the form is building the table on the first site, it adds a string of code after the URL (?string of code here). That doesn't happen on the second site. I don't know if that can be adjusted via the JavaScript or not.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    form method

    I notice the form has an method attribute value of "submit". AFAIK the only values are "get" and "post". It seems the working page is using the default GET (the vars and vals appended to the URL). Perhaps the broken page doesn't make the decision to use the default and just breaks going to the home page instead. Try changing the form's method attribute to "get" and see if that works.


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
  •