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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:34:17+00:00 2026-05-23T08:34:17+00:00

Goal: Display the value of the calculation in the html page. problem: After you

  • 0

Goal:
Display the value of the calculation in the html page.

problem:

After you have clicked on the submit
button, the calculation will be
beginning. Thereafter, the page
started reloading again by executing
“window.onload”. This consq makes that
I can’t view the calculated result.

I just wanna “window.onload” to be loaded once and after that I wanna add more data in the page by pressing submit button without reloading the whole page again. After you have pressed the submit button, that data should be visible.

// fullmetalboy


    <script type ="text/javascript" charset="utf-8" src="scripts/data.js"></script>
</head>
<body>
    <div id ="container">
        <div id ="header">

        </div>
        <div id ="content">

            <table id ="pricetable">
                <thead>
                    <tr>
                        <th>Articlenumber</th>
                        <th>Product</th>
                        <th>Name</th>
                        <th>Price</th>
                        <th>Quantity</th>
                    </tr>
                </thead>
                <tbody> 
                    <tr>
                        <td>223</td>
                        <td>a</td>
                        <td>a</td>
                        <td>250</td>
                        <td><input type ="text" size ="3" value ="1"/></td>
                    </tr>
                    <tr>
                        <td>223</td>
                        <td>a</td>
                        <td>a</td>
                        <td>250</td>
                        <td><input type ="text" size ="3" value ="1"/></td>
                    </tr>
                    <tr>
                        <td>223</td>
                        <td>a</td>
                        <td>a</td>
                        <td>250</td>
                        <td><input type ="text" size ="3" value ="1"/></td>
                    </tr>
                    <tr>
                        <td>223</td>
                        <td>a</td>
                        <td>a</td>
                        <td>250</td>
                        <td><input type ="text" size ="3" value ="1"/></td>
                    </tr>
                </tbody>
            </table>





        </div>
    </div>
</body>


window.onload = init; 




function init() 
{
    createForm();
    addColumn();
    addRow();
}



function addColumn()
{

    var tabellHead = document.getElementById("pricetable").tHead;

    for (var a=0; a<tabellHead.rows.length; a++) 
    {
        var nyTH = document.createElement('th');
        tabellHead.rows[a].appendChild(nyTH);
        nyTH.innerHTML = "Summa";
    }


    var tabellBody = document.getElementById("pricetable");

    for (var b=1; b<tabellBody.rows.length; b++) 
    {
        var nyTD = document.createElement('td');
        tabellBody.rows[b].appendChild(nyTD);
        nyTD.innerHTML = "";
    }

}



function addRow()
{
    var newRow  = document.createElement('tr');
    newRow.setAttribute('id', "sumrow");



    var ca1 = document.createElement('td');
    var ca2 = document.createElement('td');
    var ca3 = document.createElement('td');
    var ca4 = document.createElement('td');
    var ca5 = document.createElement('td');
    var ca6 = document.createElement('td');

    var text = document.createTextNode("asdf");


    var font = document.createElement('font');
    font.setAttribute('color', 'white');
    font.appendChild(text);



    ca6.appendChild(font);

    newRow.appendChild(ca1);
    newRow.appendChild(ca2);
    newRow.appendChild(ca3);
    newRow.appendChild(ca4);        
    newRow.appendChild(ca5);    
    newRow.appendChild(ca6);     

    var t  = document.getElementById('pricetable');

    t.appendChild(newRow);  
}



function createForm()
{
    var t  = document.getElementById('content');

    var a = "<form><input onclick='tttest();' value='Rensa' type='submit'></form>";

    t.innerHTML += a;
}




function calc()
{



        var lass = document.getElementById("pricetable");

        var tabellBody = asss.getElementsByTagName("tr");


        for (var b=1; b<tabellBody.length; b++) 
        {
            var godis = tabellBody[b].cells[4].childNodes[0];
            var godia = tabellBody[b].cells[3];

            var a = godia.innerHTML * godis.value;

            var text = document.createTextNode(a);


            //tabellBody.rows[b].cells[5].innerHTML = a;

            var celler = tabellBody[b].getElementsByTagName("td");

            var medelelement = celler[celler.length - 1];

            medelelement.appendChild(text);

        }


}
  • 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-23T08:34:17+00:00Added an answer on May 23, 2026 at 8:34 am

    Just change the submit button to a normal button so that it doesn’t submit the form when clicked.

    var a = "<form><input onclick='tttest();' value='Rensa' type='button' /></form>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

goal : I want to place a text after the submit button using hook_form_alter.
On a Drupal app, my goal is to display a page with a couple
Possible Duplicate: Function to Calculate Median in Sql Server Goal: Display the value of
Goal: Automatically display the first value from the enum Housing instead of displaying white
Goal: When you are entering the address calculation or project.html, one of the main
Goal: Display Encapsulate field from Player Problem: Want to display datamember_id , _name and
I want to refresh the same page and display the entered value in text
My goal is to display two <div> s side-by-side with the content from both
goal: I have the string 1234432144 I want to only replace the first 2
Goal : After user saves data to my mysql DB, a JSON teaser 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.