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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:55:35+00:00 2026-05-30T10:55:35+00:00

I have a couple of text boxes that accept numeric values. When a user

  • 0

I have a couple of text boxes that accept numeric values. When a user enters a value in one of them it should run a calculation and display it in the other textbox (& vice versa). I’ve been playing around with the code and have got this, however it doesn’t seem to display the value.

<form oninput="valueB.value=valueA.value+900">
    <input type="number" name="valueA" value="" />
</form>

<form oninput="valueA.value=valueB.value+300">
    <input type="number" name="valueB" value="" />
</form>

I notice that there is the <output> tag that can be used to display results, however I don’t see how I’d make use of this to display the value in the text box. Please can someone offer some advice on what to do?

  • 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-30T10:55:37+00:00Added an answer on May 30, 2026 at 10:55 am

    Elements should not have global references pointing to them via their name attribute. If you change the name attribute to id, you will see that it almost works as expected, you just need to cast the value to a number before performing the addition.

    Demo: http://jsfiddle.net/AndyE/nvQLb/


    As a general rule, you should keep your JavaScript and HTML separate, and refer to elements in the document using a fetching method like document.getElementsByName or document.querySelector. That way, your code is easier to maintain and you will avoid any ambiguities that may arise by variables having the same name as a DOM element’s id.

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

Sidebar

Related Questions

I have a report that takes two parameters from a couple of text boxes
I have a panel and in it are a couple of text boxes, I
I've seen buttons that have some nice shape. I downloaded a couple of them
I have couple of text boxes. In those text boxes I need to check
I have a form that is composed of a couple of text fields and
I have a linear layout with a couple text boxes, vertical. I want to
We have an aspx page with Twenty text boxes and couple of Dropdownlists. Is
Okay, so, I have a couple text files that are written to and read
I have a couple of textboxes that will contain dates only. If one textbox
I have a text file of URLs, about 14000. Below is a couple of

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.