SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Why the calculate button won't work?

    Hi guys

    Just wondering why this not working the link below, when I press the calculate button.
    http://coder9.com/calc/

    It supposed to print/echo something.

    Thank you very much in advanced.
    I Love coding...
    Don't click this link.

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    266
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    There is errors in JS code, for example, at this line you should add a value to that variable:
    Code:
    var finalterm=;
    Use Mozilla Firefo with Firebug addon to see the errors.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MarPlo View Post
    Use Mozilla Firefox with Firebug addon to see the errors.
    The built-in error console is sufficient for that.
    Tab-indentation is a crime against humanity.

  4. #4
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    why is it this while loop make the page unresponsive?

    Code:
    while (ir2!=tip)
    {
    	//interest=interest+0.01;
    	//val=(amount*interest/(100*12))*(1/(1-1/(Math.pow(1+interest/(12*100),month))));
    	//ir2=((val*month)-amount).toFixed(8);
    			
    	ir2=ir2+0.01;
    			
    	document.getElementById("ir").value=ir2;
    }
    I just want to print the value of ir2 into input box of ir1;
    What is the solution to this?

    Thank you very much in advanced.
    I Love coding...
    Don't click this link.

  5. #5
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    while (ir2!=tip)
    {
    Before you enter the loop, you must ensure that both variables are numeric types, and that ir2 is less than tip by an even multiple of 0.1. Even then rounding errors could cause the comparison to fail.

    You may want to re-think that test.
    Tab-indentation is a crime against humanity.


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
  •