Results 1 to 6 of 6

Thread: Multiple If statements

Threaded View

  1. #1

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Resolved Multiple If statements

    Hey everyone I need a little help again I am rewriting my calculator program and am having problems with my code...

    VB Code:
    1. function disp_prompt()
    2. {
    3. var i= document.getElementById("investment").value;
    4. var r= document.getElementById("reinvest").value;
    5. r=r - 0;
    6. i=i - 0;
    7. c=0+1
    8. s=0
    9. s1=100
    10. s2=1000
    11. s3=10000
    12. q=100
    13. q2=200
    14. q3=300
    15. total=0
    16.  
    17. if (i>s && i<s1);
    18. if (c=1)<----- I cant get JS to recognize this code it just passes over it... or just doesnt do anything
    19. {
    20. total=i + i * q / 100
    21. for (i=2;i<=r;i++)
    22. total=total + total * q / 100
    23.  
    24. document.getElementById("profit").value= "$" +total 'but if i add a "+ c" it will add the number...
    25.  
    26. }
    27. else
    28. {
    29. total=1000009
    30.  
    31. document.getElementById("profit").value= "$" +total
    32. }
    33. }


    What am I doing wrong????
    Last edited by messup000; Jan 12th, 2006 at 12:26 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width