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>
Re: I can't see this java script after installing
Quote:
Originally Posted by
ablafontain
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.
Re: I can't see this java script after installing
Quote:
Originally Posted by
ablafontain
What am I doing wrong? thanks
Maybe if we knew what steps you took we would be able to tell you. :D
beaten to the post by Sledger ..... again!!! :D
Re: I can't see this java script after installing
Yeah, what are your steps when finishing the process.
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?
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.
Re: I can't see this java script after installing
You maybe need to check the value.