Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:54:48+00:00 2026-06-08T05:54:48+00:00

all I’ve written a function in order to calculate many things, so I’ve put

  • 0

all I’ve written a function in order to calculate many things,

so I’ve put the value of my vars in input of type hidden, so we have this code:

 <input type="hidden" id="p1" value="5000.00">
 <input type="hidden" id="p2" value="5000.01">
 <input type="hidden" id="p3" value="8000.00">
 <input type="hidden" id="p4" value="8000.01">
 <input type="hidden" id="t1" value="15.0">
 <input type="hidden" id="t2" value="12.0">
 <input type="hidden" id="t3" value="6.0">
 <input type="hidden" id="versement" value="12554.35">
 <input type="hidden" id="type" value="d">

Moreover, I’ve have the following code, first an input in order to write the amount to be calculated:

and the function on the top:

so we have:

 <script language="text/javascript">
 function hono(p1,p2,p3,p4,t1,t2,t3,type,versement,montantacompte)
 {
     var p1             = document.getElementById("p1").value;
     var p2             = document.getElementById("p2").value;
     var p3             = document.getElementById("p3").value;
     var p4             = document.getElementById("p4").value;
     var t1             = document.getElementById("t1").value;
     var t2             = document.getElementById("t2").value;
     var t3             = document.getElementById("t3").value;
     var type           = document.getElementById("type").value;    
     var versement      = document.getElementById("versement").value;
     var montantacompte = document.getElementById("montantacompte").value;

     if (type== "d")
        {
            if(versement== 0 && montantacompte <= p1)
            {
                reste1= montantacompte;
                pc= t1/100;
                taux1= pc+1;
                h1=((reste1*taux1)+reste1);
                honoraires=h1;
                document.getElementById('taux-1').value=taux1;
                document.getElementById('palier1').value=h1;
                document.getElementById('sommehonoraires').value=honoraires;
            }
            else if(versement < p1 && (versement + acompte) <= p1)
            {
                reste1= montantacompte;
                pc= t1/100;
                taux1= pc+1;
                h1= (reste1*taux1)-reste1;
                honoraires= h1;
                document.getElementById('taux-1').value=taux1;
                document.getElementById('palier1').value=h1;
                document.getElementById('sommehonoraires').value=honoraires;
            }
            else if(versement <= p1 && (versement+montantacompte)>= p2 && (versement+montantacompte)<=p3)
            {
                reste1=p1-versement;
                pc=t1/100;
                taux1=pc+1;
                h1=(reste1*taux1)-reste1;
                reste2=montantacompte-reste1;
                pc2=t2/100;
                taux2=pc2+1;
                h2=(reste2*taux2)-reste2;
                honoraires=h1+h2;
                document.getElementById('taux-1').value=taux1;
                document.getElementById('palier1').value=h1;
                document.getElementById('taux-2').value=taux2;
                document.getElementById('palier-2').value=h2;
                document.getElementById('sommehonoraires').value=honoraires;
            }
            else if (versement==0 && montantacompte>=p2 && montantacompte <=p3)
            {
                reste2=montantacompte-p1;
                reste1=p1;
                pc=(t1/100);
                taux1=pc+1;
                h1=((reste1*taux1)-reste1);
                pc2=(t2/100);
                taux2=pc2+1;
                h2=((reste2*taux2)-reste2);
                honoraires=(h1+h2);
                document.getElementById('taux-1').value=taux1;
                document.getElementById('palier1').value=h1;
                document.getElementById('taux-2').value=taux2;
                document.getElementById('palier2').value=h2;
                document.getElementById('sommehonoraires').value=honoraires;
            }
            else if(versement<=p3 && versement>=p2 && (versement+montantacompte)>=p2 && (versement+montantacompte)<=$3)
            {
            reste1=montantacompte;
            pc=($2/100);
            taux1=pc+1;
            h1=((reste1*taux1)-reste1);
            honoraires=h1;  
            document.getElementById('taux-1').value=taux1;
            document.getElementById('palier1').value=h1;
            document.getElementById('sommehonoraires').value=honoraires;
            }
            else if(versement>=p2 && versement<=p3 && (versement+montantacompte)>=p4)
            {
            reste1=p4-versement;
            pc=(t2/100);
            taux2=pc+1;
            h2=((reste1*taux2)-reste1);
            reste2=montantacompte-reste1;
            pc2=(t3/100);
            taux3=pc2+1;
            h3=((reste2*taux3)-reste2);
            honoraires=(h2+h3);
            document.getElementById('taux-3').value=taux3;
            document.getElementById('palier3').value=h3;
            document.getElementById('taux-2').value=taux2;
            document.getElementById('palier2').value=h2;
            document.getElementById('sommehonoraires').value=honoraires;
        }
        else if(versement==0 && montantacompte>=p4)
        {
            reste1=p1;
            reste2=p3-p2;
            pc=(t1/100);
            taux1=pc+1;
            h1=((reste1*taux1)-reste1);
            pc2=(t2/100);
            taux2=pc2+1;
            h2=((reste2*taux2)-reste2);
            reste3=(montantacompte-reste1-reste2);
            pc3=(t3/100);
            taux3=pc3+1;
            h3=((reste3*$taux3)-reste3);
            honoraires=(h1+h2+h3);
            document.getElementById('taux-1').value=taux1;
            document.getElementById('palier1').value=h1;
            document.getElementById('taux-3').value=taux3;
            document.getElementById('palier3').value=h3;
            document.getElementById('taux-2').value=taux2;
            document.getElementById('palier2').value=h2;
            document.getElementById('sommehonoraires').value=honoraires;
        }
    else if(versement>=p4)
        {
            reste3=montantacompte;
            pc3=($3/100);
            taux3=pc3+1;
            h3=((reste3*taux3)-reste3);
            honoraires=(h3);
            document.getElementById('taux-3').value=taux3;
            document.getElementById('palier3').value=h3;
            document.getElementById('sommehonoraires').value=honoraires;
        }
    }
    if (type=="l")
    {
    pc1=(t1/100);
    taux1=pc1+1;
    honoraires=montantacompte*taux1;
    document.getElementById('taux-1').value=taux1;
    document.getElementById('palier1').value=h1;
    document.getElementById('sommehonoraires').value=honoraires;
    }
 }

 </script><input type="text" name="montantacompte" id="montantacompte" onKeyUp="hono(p1,p2,p3,p4,t1,t2,t3,type,versement,montantacompte)"  /> 

And in the console it says to me that the function is not defined, or it is, because i’ve written it…
All is in the body.

We have this in the console:

Uncaught ReferenceError: hono is not defined test.php:166
onkeyup

and the line 166 is where there is the input type text after the function.

sorry for my bad English,

If you need more precisions, just ask me,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:54:50+00:00Added an answer on June 8, 2026 at 5:54 am

    language="text/javascript" is wrong it should be language="JavaScript" but thats old/outdated/obsolete/depreciated so use type="text/javascript" instead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All I have the following form input element: <input name=payment_amount type=text id=payment_amount value= disabled>
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
All, Say I have the following bit of code: select: function(start, end, allDay) {
All I want is to make a simple user password login. I have put
All -- I have these two methods in one of my classes: public static
All, See the code below: function menu() { this.menuitem=[]; this.submenu=[]; this.menuitem[0] = $('div#sivname1'); this.menuitem[1]
All, I have some script tags that are not working in Wordpress. If I
all I want to calculate the height of the page ,and in my test.less
All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status='booked'
All the examples of use and tutorials I have found on beginBackgroundTaskWithExpirationHandler: show how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.