Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

How do I call this javascript function from ASP?

function IRRCalc(CArray, guest) {
     if (!guest) {
          guest = 0.00;
     }
     inc =0.00001;

     do
     {
          guest += inc;
          NPV = 0;
          for (var j=0; j<CArray.length; j++)
          {
               NPV += CArray[j]/Math.pow((1+guest),j);
          }

     }while(NPV > 0);

    return guest * 100;
}
0
sbornstein2
Asked:
sbornstein2
1 Solution
 
archrajanCommented:
if u want to call from a button call it like this

<input type = "button" name = "btn" onclick = " IRRCalc(CArray, guest)">
u have to replace the arguments with the argument u want to pass to the function

u can call javascript on some events like
onclick
onfocus
onblur
onchange

etc

0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now