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 8090245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:39:35+00:00 2026-06-05T19:39:35+00:00

HTML <input name=pm type=text value=0/> <input name=pm type=text value=0/> <input name=pm type=text value=0/> <input

  • 0

HTML

<input name="pm" type="text" value="0"/>
<input name="pm" type="text" value="0"/>
<input name="pm" type="text" value="0"/>

<input name="total" type="text" value="0" disabled="disabled"/>

Javascript

$('[name="pm"]').keypress(function() {

//implementation ?

});

I have three text box by default value =0, as user write any one of the these three text box, total must be shown in total text box.
Key press event working fine for all three text boxes.

  • 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-05T19:39:36+00:00Added an answer on June 5, 2026 at 7:39 pm

    Simple demo http://jsfiddle.net/mZBtg/

    Please note: I have used keyup api but it will give you same result what you are looking for.

    http://api.jquery.com/keyup/

    http://api.jquery.com/keypress/

    You can also do isNumeric and isNan check; good link: $.isNumeric vs. isNaN Also please see comments below. B-)

    Feel free to play around and hope this help.

    code

    $('input[name="pm"]').keyup(function() {
        var sum = 0;
        $('input[name="pm"]').each(function(){
            sum += parseInt(this.value);
        });
       $('input[name="total"]').val(sum);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML <form id=create-template class=form action= method=post> <p class=_50> <label for=t-name>Template name</label> <input type=text name=t-name
HTML <form id=contact_form action=# name= method=POST> <label for=name>NAME</label> <input type=text name=name id=name class=contact_form_input />
html code <div id="signup"> <p> <label>Frist Name</label> <input type="text"/> <p> <p> <label>Last Name</label> <input
I have a table inside a form that looks as follows: <td><input type=text name=code[0]
So I have the following html: <div id=divForComponents> <input type=button value=+ onclick=addFilter('divForComponents')/> </div> And
I have the following Javascript code: function checkIfValid(){ var form = document.createuserform; if(form.fName.value ==
html code <div id="signup"> <form id="suform" method="POST" action="roma/roma"> <p> <label>Frist Name</label> <input type="text" id="sufName"/>
I have two HTML input boxes, that need to calculate the time difference in
Example I had 2 html input <div class=wrap> <input class=autocomplete name=auto_1 /> <input class=autocomplete
Using the following HTML input and Javascript, a user can add up to 3

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.