Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Scripting > Javascript   »   event handler function

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Feb 15, 2008, 10:26 AM
boobiesonthetree
New Member
boobiesonthetree is offline
 
Join Date: Feb 2008
Posts: 2
boobiesonthetree See this member's comment history on his/her Profile page.
event handler function

can somebody please please help me with this question ive been trying to do it for days and days and just cant get my head around it i know what im supposed to do but just dont know where to start this is the question and this is the code:-

Clicking the button Add receipts to stock calls an event handler function that updates the arrays productStock and receivedLevels, by adding the receipts for each product to the value in productStock, and then setting the values receivedLevels to 0. The system should then display the new totals. Write this function.

<HTML>
<HEAD> M150 TMAO3 Question 3
<TITLE>SOFASPEND - IN THE BEST POSSIBLE TASTE!</TITLE>

<SCRIPT

language="JavaScript"
type="text/javascript">


// These are arrays containing product data

var productDescriptions = ['Superslurry electric blender', 'Apple - iPod (second-hand)',

'CoziNap nylon duvet tog 2', 'Headbanger mini hi-fi 20W', 'MagiBoot shoe cleaning kit',

'The PushmiPulu lawnmower'];

var productPrices = [45, 50, 15, 25, 75, 7];

var productStock = [200, 0, 2, 500, 50, 15];

var receivedLevels = [50, 10, 150, 500, 50, 100];



// Write the function showStockLevels() here

function showStockLevels()
/* display product stock in twelve text boxes */

{
document.administrator.ssMainStock.value='200';
document.administrator.aiMainStock.value='0';
document.administrator.cnMainStock.value='2';
document.administrator.hbMainStock.value='500';
document.administrator.mbMainStock.value='50';
document.administrator.ppMainStock.value='15'
document.administrator.ssReceivedStock.value='50'
document.administrator.aiReceivedStock.value='10'
document.administrator.cnReceivedStock.value='150'
document.administrator.hbReceivedStock.value='500'
document.administrator.mbReceivedStock.value='50'
document.administrator.ppReceivedStock.value='100'
};

// Write the function addAllReceivedItems() here



// Write the function calculateTotals() here



</SCRIPT>

</HEAD>

<BODY>

<FORM NAME = "administrator">
<BR>
SOFA SPEND plc. CURRENT STOCK LEVELS<BR><BR>
Superslurry electric blenders <BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "ssMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "ssReceivedStock"
VALUE = "">
<BR><BR>
Apple iPods (second hand) <BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "aiMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "aiReceivedStock"
VALUE = "">
<BR><BR>
CoziNap duvets<BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "cnMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "cnReceivedStock"
VALUE = "">
<BR><BR>
Headbanger hi-fi<BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "hbMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "hbReceivedStock"
VALUE = "">
<BR><BR>
Magiboot cleaning kits<BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "mbMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "mbReceivedStock"
VALUE = "">
<BR><BR>
PushmiPulu lawnmowers<BR> Current stock
<BR>
<INPUT TYPE = "text"
NAME = "ppMainStock"
VALUE = "" >
Received:
<INPUT TYPE = "text"
NAME = "ppReceivedStock"
VALUE = "">
<BR><BR>
<INPUT TYPE = "button"
VALUE = "Show all stock holdings"
ONCLICK = "showStockLevels()">

<INPUT TYPE = "button"
VALUE = "Add receipts to stock"
ONCLICK = "addAllReceivedItems()">
<BR><BR>

</FORM>

<FORM NAME = "statistics">
Total main stock items<BR>
<INPUT NAME = "mainStock"
"TYPE = "text"
VALUE = '' >
<BR>
Total received stock items<BR>
<INPUT NAME = "receivedStock"
"TYPE = "text"
VALUE = '' >
<BR>
Total number stock items --- Total value of stock ------- Total tax payable<BR>
<INPUT NAME = "allStock"
"TYPE = "text"
VALUE = '' >
<INPUT NAME = "allStockValue"
"TYPE = "text"
VALUE = '' >
<INPUT NAME = "allTax"
"TYPE = "text"
VALUE = '' >
<BR><BR>
Press button to calculate .........
<INPUT TYPE = "button"
VALUE = "Calculate totals"
ONCLICK = "calculateTotals()">
</FORM>

</BODY>

</HTML>

Reply With Quote
 
     



Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
Your thoughts on this event? dad66 Children 21 Jul 19, 2007 05:45 PM
can't remember event GracieTanner Mental & Emotional Health 8 Jan 17, 2007 05:21 AM
event mangement jaee Management 1 Dec 7, 2006 02:31 PM
Special Event LeeBee Weight Loss 1 Feb 13, 2006 04:49 PM
Customer Event manser Marketing 1 Feb 15, 2005 06:30 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 03:53 AM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.