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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:19:47+00:00 2026-06-08T00:19:47+00:00

I am trying to use this function: function storagecalc(){ var thediv=document.forms[boxes]; var boxno=thediv.elements[numbofboxes]; var

  • 0

I am trying to use this function:

function storagecalc(){
var thediv=document.forms["boxes"];
var boxno=thediv.elements["numbofboxes"];
var howmany =0;    //If the textbox is not blank    */
if(boxno.value!="")    
{        
howmany=parseInt(quantity.value);    
}
return howmany;
document.getElementById('numberprice').innerHTML = "£"+howmany;
}

To grab a value entered here:

<form action="" id="boxes">

<input type="text" id="numbofboxes" value="" name="boxnumber"/>

<button id="smtbxno" onclick="storagecalc">

<img src="images/tick.gif" alt="proceed"/>

</button>

</form>

and display it here:

<div id="grandtotal">

<p class="calctitles">

Grand Total

</p>

<p id="numberprice">

</p>

</div>

Nothing is happening when I enter a value into the textbox and click the button, is this because the button also has jQuery that hides itself and the text box upon clicking?
If not any suggestions for why it won’t work?

  • 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-08T00:19:48+00:00Added an answer on June 8, 2026 at 12:19 am

    If I hide a text input element with javascript, can other javascript functions still access a value entered into it?

    Every piece of javascript that can obtain a reference to the input element (via a variable, with a DOM selector) can access its value. The visibility of that element has no effect on any of those actions. Only if you would detach it from the DOM, other functions could not select it with DOM methods.


    OK, there are some errors in the document you gave us:

    • <button onclick="storagecalc"> does not execute anything, you will need to call the function: <button onclick="storagecalc();">. Only when assigning a listener to the onclick property with js, the function object needs to be used (document.getElementById("smtbxno").onclick = storagecalc;).
    • In the function itself, you use a variable quantity which is undefined (and throws an exception). I’m not sure how to fix that.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use this function from a COM API which enables the
I'm trying to use translation in a custom twig filter like this public function
I am trying to use a function pointer and I am getting this error:
I am trying to use preg_replace function to parse this table in a Html
I'm trying to use SendInput() function. I wrote this code: #include <stdio.h> #include <stdlib.h>
I'm trying to use the .Contains() function on a list of custom objects. This
I'm trying to use this function in a C program that needs to be
I am trying to use this simple function from this page: http://www.haskell.org/haskellwiki/99_questions/Solutions/2 But when
I'm trying to figure out how to use this function. I found it on
I am trying to use this jQuery click() function and for some arcane reasons

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.