[Javascript] global vars prob?!

Steven Chipman sgchipman at gmail.com
Fri Feb 10 08:20:26 CST 2006


> > the numRow value for the products_price_return() function
> > always receives the nighest value of numRow from after the loop, in
> > this case 6,
> > but not of the value it had when i created the element which should
> > have been 2 in the 2nd created textarea.
> >
> > how can i achieve my goal,
> > does anybody understand?

I've gotten around this problem in the past by assigning a new
attribute to the object, say "xIndex", and then using it instead of
the increment var in the function argument. For example:

inputProductsDescription.xIndex = numRow;
inputProductsDescription.onfocus=function() {
products_price_return(this.xIndex); }



--
steve
http://slayeroffice.com



More information about the Javascript mailing list