[Cialug] JS Question

Barry Von Ahsen barry at vonahsen.com
Mon Jan 28 13:52:03 CST 2013


I'm not sure if this.form is valid for a child of said form.  does it work passing document.form (or document.form[0])?

or if it's not checked, I don't think it has a value yet - does VV.checked==true work?



-barry


On Jan 28, 2013, at 1:40 PM, L. V. Lammert wrote:

> Since the topic today has been JS, .. could someone please tell me what is
> wrong the first line of this function? Every time I try to do some simple
> stuff on a page I am reminded as to why I hate JS <g>!
> 
> 	PrintedAlso is a checkbox, with 1 as a checked value
> 	On check, the first line consistantly returns a "Typedef
> 	Error = VV Undefined".
> 	The last four lines run just fine, updating the respective
> 	elements.
> 
> My question how can VV be undefined in the first line and *defined* in
> the third? [VV is passed as "this.form" on the OnChange event for each
> element.]
> 
> function UpdateTotal(VV) {
> 	if (VV.PrintedAlso.value="1") { VV.TotalPrinted.value=5; }	<<
> 	else { VV.TotalPrinted.value==0; }
> 	VV.TotalRegular.value = fmt(sub1=VV.NumRegular.value * 10.00);
> 	VV.TotalJunior.value = fmt(sub2=VV.NumJunior.value * 2.00);
> 	VV.TotalPrinted.value = fmt(sub3=VV.TotalPrinted);
> 	VV.GrandTotal.value = fmt(sub1 + sub2 + sub3);
> }
> 
> 	TIA!
> 
> 	Lee
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug



More information about the Cialug mailing list