Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2006, 07:57 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding generated fields

This is my first attempt at a web form and everything works until the final function, which returns a ReferenceError of:

E = (document.getElementById("Distribution5"), A + B + C + D, System.ReferenceError('Reference required on left side of assignment operator'));

This is the code I'm trying to use:

<script>
function cal1(){
var Units = document.getElementById('Units').value;
var Payout = document.getElementById('Payout').value;
document.getElementById('Distribution').value =Units*Payout;
}
</script>

<script>
function cal2(){
var Units2 = document.getElementById('Units2').value;
var Payout2 = document.getElementById('Payout2').value;
document.getElementById('Distribution2').value =Units2*Payout2;
}
</script>

<script>
function cal3(){
var Units3 = document.getElementById('Units3').value;
var Payout3 = document.getElementById('Payout3').value;
document.getElementById('Distribution3').value =Units3*Payout3;
}
</script>

<script>
function cal4(){
var Units4 = document.getElementById('Units4').value;
var Payout4 = document.getElementById('Payout4').value;
document.getElementById('Distribution4').value =Units4*Payout4;
}
</script>

<script>
function cal5() {
A = document.getElementById('Distribution');
B = document.getElementById('Distribution2');
C = document.getElementById('Distribution3');
D = document.getElementById('Distribution4');
E = (A + B + C + D)
E = document.getElementById('Distribution5')= A+B+C+D;
}
</script>

I am sure this is very elementary but any help would be very much appreciated!

TIA


Mfero
University of Washington
Treasury Office
 
Old June 19th, 2006, 04:10 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Mfero!!
same question on multiple forum
http://p2p.wrox.com/topic.asp?TOPIC_ID=45819

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding fields to the crystal report Pravin.k Crystal Reports 2 January 3rd, 2008 09:35 AM
Adding Time Fields Brendan Bartley Access 3 July 30th, 2006 08:35 PM
Adding dynamic fields ivnavin Crystal Reports 0 December 17th, 2004 03:35 PM
saving dynamiccally generated fields into Access Toran Classic ASP Basics 14 June 28th, 2003 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.