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

  • Home
  • SEARCH
  • 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 8914817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:49:23+00:00 2026-06-15T04:49:23+00:00

I am trying to make this code bellow to work, I would really appreciate

  • 0

I am trying to make this code bellow to work, I would really appreciate your help. Basicly it is Calculation of sum of three input fields and then multiplication with two other fields. The final result should be shown in a input field pcamount.

Here is the exemple in jsFiddle: http://jsfiddle.net/D98PW/

Bellow is the jquery script and the html

Thanks in advance for your help!

 $(document).ready(function() {
   $('input[name=deposit], input[name=minpremium], input[name=adjpremium],input[name=procombaserate], input[name=profcomper], input[name=pcamount]').change(function(e)  {
        var total_mnozi = 0;
        var total=0;
        var $row = $(this).parent();
        var dep = $row.find('input[name=deposit]').val();
        var minpre = $row.find('input[name=minpremium]').val();
        var adjpre = $row.find('input[name=adjpremium]').val();
        var procombase = $row.find('input[name=procombaserate]').val();
        var profcomper = $row.find('input[name=profcomper]').val();
       // var pcamount= $row.find('input[name=pcamount]').val();
       // total_mnozi= procombase * profcomper;
         $('dep, minpre, adjpre').each(function() {
       total += parseFloat($(this));
          total_mnozi = total * procombase * profcomper;
          $row.find('input[name=pcamount]').val( total_mnozi);

  });   
    });
   });

And the html

<table >
    <tr>  
        <td><label>MIN Premium</label></td>
         <td class="toadd"><input type="text" class="input1" name="minpremium" id="minpremium" value=""></td>   
       </tr>
        <tr>
          <td><label>Deposit</label></td>                              
         <td ><input type="text" name="deposit" id="deposit" class="input1" size="20" value=""></td>
          <td></td><td></td>  
       </tr>
       <tr>
       <td><label>Adjustment Premium</label></td>                              
       <td ><input type="text" name="adjpremium" id="adjpremium" class="input1" size="20" value=""></td>
        <td><label>Return Premium</label></td>
         <td><input type="text" class="input1" name="returnpremium" id="returnpremium"></td>
         </tr>
        <tr>   
        <td><label>Tax Allocation</label></td>
        <td><input type="text" class="input1" name="taxalloc" id="taxalloc"></td>
        <td><label>Premium Base Rate</label></td>
        <td><input type="text" class="input1" name="pramiumbase" id="pramiumbase"></td>
       </tr>
       <tr>
        <td><label>Adjustable Rate</label></td>
        <td><input type="text" class="input1" name="adjrate" id="adjrate" class="input1" size="20" value=""></td>
        <td><label>PC Base Rate</label></td>
         <td><input type="text" class="input1" name="procombaserate" id="procombaserate" class="input1" size="20" value=""></td> </tr>
        <tr>
           <td><label>Profit Commission %</label></td>
             <td><input type="text" class="input1" name="profcomper" id="profcomper" value=""></td>
              <td><label>PC Amount</label></td>
         <td><input type="text" class="input1" name="pcamount" id="pcamount" class="input1" size="20" >
                    </td>                   
       </table>   
  • 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-15T04:49:25+00:00Added an answer on June 15, 2026 at 4:49 am

    Since you are using IDs on all your input fields you can use that instead of NAME attribute. It’s a bit shorter and more transparent.

    You can bind change call to all your input elements or if you wish to limit them you can use $('input#ID1, input#ID2,...') where ID1,ID2… is ID of element you wish to set it to.

    $(document).ready(function() {
       $('input').change(function(e)  {
            var total_mnozi = 0;
            var dep = parseFloat($('#deposit').val());
            var minpre = parseFloat($('#minpremium').val());
            var adjpre = parseFloat($('#adjpremium').val());
            var procombase = parseFloat($('#procombaserate').val());
            var profcomper = parseFloat($('#profcomper').val());
    
            total_mnozi = (dep+minpre+adjpre) * procombase * profcomper;
            $('#pcamount').val( total_mnozi);
        });
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make this code generic: public final Object unwrap(Class arg0) { throw
I'm trying to make a multithreaded server/client app with java ! this code is
I am trying to make a simple alarm. in this code portion a take
I'm trying to make a python binding for the this library: http://code.google.com/p/hosterslib/ . I'm
Currently I'm trying to make a flowchart, this is the code I've got so
I get this error when trying to make the executable, the code compiles correctly
I am trying to make this sample program work (defn foo ([x] (foo x
Ok I am trying to make this simple thing but it won't work. I
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I'm trying to make this: 174,myfilename.jpg Into this on the php post process page:

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.