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;
}
sbornstein2Asked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.