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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:37:32+00:00 2026-05-25T09:37:32+00:00

I have 3 text boxes (testbox, testbox2, testbox3) that get values from an input

  • 0

I have 3 text boxes (testbox, testbox2, testbox3) that get values from an input field, radio button selection and checkbox/tick. The correct values go into testbox, testbox2, testbox3.

However, I need the total of testbox, testbox2, testbox3 to go into text box ‘total’ – with the total to change if the users selects different radio buttons or tick/unticks etc..

One more thing I need the total to also be shown in the form, echo, (in addition to going into the text box – which will eventually be hidden).

Thank you.

 <head>
 <script type="text/javascript">
 function checkboxClick() {
 var textbox = document.forms[0].testbox3;
 textbox.value = (textbox.value == 0) ? '1.00' : '0.00';
 }
 </script> 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Untitled Document</title>
 </head>
 <form action="" method="get">
 <input name="form1" type="radio" onclick="document.forms[0].testbox2.value='0.00'; "/>
 <input name="form1" type="radio" onclick="document.forms[0].testbox2.value='1.00'; "/>
 <input name="" type="checkbox" value="" onclick='checkboxClick()'/>
 <input name="testbox" type="text" value"2.00"/>
 <input name="testbox2" type="text" value"0.00"/>
 <input name="testbox3" type="text" value="0.00"/>

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

 </form>
 <body>
 </body>
 </html>
  • 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-05-25T09:37:33+00:00Added an answer on May 25, 2026 at 9:37 am

    How about writing a function to update the total (and being careful to parse the textbox inputs as floats):

      function updateTotal() {
        var textbox1val = parseFloat(document.forms[0].testbox.value);
        var textbox2val = parseFloat(document.forms[0].testbox2.value);
        var textbox3val = parseFloat(document.forms[0].testbox3.value);
        var total = textbox1val + textbox2val + textbox3val;
        document.forms[0].total.value = total;
      }
    

    And then calling this function in an onchange attribute?

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

Sidebar

Related Questions

I have a panel and a button that adds text boxes to the panel
I have text input boxes. There is validation for each of the boxes using
I have 2 text boxes and a submit button.On clicking on the submit button
I have 6 text boxes on an asp page and one search button. Users
I have two text boxes, one for a billing address field and one for
I have a text field have value http://localhost/Send/test.php?s/?a=1&o=2 . Another three text boxes. If
I have a series of of tabs that hold text boxes in them. Some
I have a Panel control that contains some control such as text boxes.I want
I have two text boxes t1 and t2 in an html page. I'd like
I have three text boxes on the stage id=red, blue, green same as the

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.