Welcome to TalkGraphics.com
Results 1 to 7 of 7
  1. #1

    Default I can't see this java script after installing

    What am I doing wrong? thanks





    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function checkForZero(field) {
    if (field.value == 0 || field.value.length == 0) {
    alert ("This field can't be 0!");
    field.focus(); }
    else
    calculatePayment(field.form);
    }

    function cmdCalc_Click(form) {
    if (form.price.value == 0 || form.price.value.length == 0) {
    alert ("The Price field can't be 0!");
    form.price.focus(); }
    else if (form.ir.value == 0 || form.ir.value.length == 0) {
    alert ("The Interest Rate field can't be 0!");
    form.ir.focus(); }
    else if (form.term.value == 0 || form.term.value.length == 0) {
    alert ("The Term field can't be 0!");
    form.term.focus(); }
    else
    calculatePayment(form);
    }

    function calculatePayment(form) {
    princ = form.price.value - form.dp.value;
    intRate = (form.ir.value/100) / 12;
    months = form.term.value * 12;
    form.pmt.value = Math.floor((princ*intRate)/(1-Math.pow(1+intRate,(-1*months)))*100)/100;
    form.principle.value = princ;
    form.payments.value = months;
    }
    //-->
    </SCRIPT>

  2. #2

    Default Re: I can't see this java script after installing

    Quote Originally Posted by ablafontain View Post
    What am I doing wrong?
    You're not supplying us with an URL to the page you have used this script, or the xara file for us to inspect.
    And we'd like rather more information about it too if you could please.

  3. #3
    Join Date
    Mar 2009
    Location
    England
    Posts
    1,996

    Default Re: I can't see this java script after installing

    Quote Originally Posted by ablafontain View Post
    What am I doing wrong? thanks
    Maybe if we knew what steps you took we would be able to tell you.

    beaten to the post by Sledger ..... again!!!

  4. #4
    Join Date
    Dec 2012
    Posts
    4

    Default Re: I can't see this java script after installing

    Yeah, what are your steps when finishing the process.

  5. #5
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    26,628

    Default Re: I can't see this java script after installing

    Looking at the script (and understanding nothing) I see that it wants you to replace the 0 value with some other value.

    But also, something is missing here. How are these values being input? This script appears to be for checking that input matches this criteria.

    Is there another script that goes with this one?

  6. #6
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    11,584

    Default Re: I can't see this java script after installing

    Looks like a script for working out a loan or something similar. These values are entered into the form, on submit the values are checked to see they're not equal to zero or have no length, then the monthly repayment are calculated and presented on the form.
    Egg
    Endangered Species
    HP xw9400 W/S / 2 x Dual Core AMD / RAM 32 GB / 120 GB Kingston SSD / 500 GB HDD / ATI Radeon HD 5450 / Windows 7 / 64 Bit /

  7. #7
    Join Date
    Nov 2012
    Posts
    4

    Default Re: I can't see this java script after installing

    You maybe need to check the value.

 

 

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
  •