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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:15:35+00:00 2026-06-15T13:15:35+00:00

This is the Html form I use. <form name=calculate method=get action=# onsubmit=return Validate()> <label>Enter

  • 0

This is the Html form I use.

<form name="calculate" method="get" action="#" onsubmit="return Validate()">
<label>Enter a number</label>
<input id="numb1" name="numb1" id="numb2" placeholder="Number 1">

<label>Enter another number</label>
<input id="numb2" name="numb2" id="numb2" placeholder="Number 2">

<label>Result</label>
<textarea style="text-align:center; height:85px; max-height:85px;" name="summ" id="summ" disabled="disabled" placeholder="Result" dir="ltr"></textarea>
<br />
<input id="calc" name="calc" type="submit" value="Calculate!">

The JS

    function Validate() {
        if (calculate.numb1.value == "" || calculate.numb2.value == "") {
            alert("Check the form again");
            calculate.numb1.focus();
            document.getElementById('summ').value = "";
            return (false);
        }
        Update()
        return (true);

    }
    function Update() {
        var plus = calculate.numb1.value + calculate.numb2.value;
        var minus = calculate.numb1.value - calculate.numb2.value;
        var mult = calculate.numb1.value * calculate.numb2.value;
        var div = calculate.numb1.value / calculate.numb2.value;

        var multi = document.getElementById("summ").value = calculate.numb1.value + "+" + calculate.numb2.value + "=" + plus + "\n" + calculate.numb1.value + "-" + calculate.numb2.value + "=" + minus + "\n" + calculate.numb1.value + "*" + calculate.numb2.value + "=" + mult + "\n" + calculate.numb1.value + "/" + calculate.numb2.value + "=" + div;
    }

All the calculations work perfectly accept the Plus function.
When you type 4+4 for example you get 44…
I tried parseFloat, but still, nothing changes.

  • 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-15T13:15:36+00:00Added an answer on June 15, 2026 at 1:15 pm
    var numb1 = parseFloat(document.calculate.numb1.value);
    var numb2 = parseFloat(document.calculate.numb2.value);
    
    var plus = numb1 + numb2;
    var minus = numb1 - numb2;
    var mult = numb1 * numb2;
    var div = numb1 / numb2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
I saw some code, html form code which looks like this: <form name=form1 method=post
I have a html form like this : <form action=https://www.123.com/cgi-bin/action method=post> <input type=hidden name=item_name
I am trying to use an HTML form and javascript (i mention this, because
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I have a html form with the data by this post method 'form id='form1'
I have a simple html form that is structured something like this: <form name=test
Okay so say I have a form element like this: HTML: <div class=form-item> <label>Current
I use cakephp FormHelper to generate html form code. echo $this->Form->create('newGallery.', array('type'=>'file')); echo $this->Form->input('Photos',array(
i use mvc3 razor in my form i use this code: @Html.ValidationMessage(Model.SMF_Name) it's not

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.