<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY 
style="WORD-WRAP: break-word; khtml-nbsp-mode: space; khtml-line-break: after-white-space">
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>i am&nbsp;creating new elements within 
for()</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>with a starting var named "id"</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>&nbsp;id = ordersNumRows;</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>&nbsp;for(o=0;o&lt;ordersNumRowsAdded;o++)<BR>&nbsp;{</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>...</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>&nbsp;&nbsp;inputProductsPrice.setAttribute("id","products_id[" 
+ id + "][products_price]");</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>&nbsp;&nbsp;inputProductsPrice.onfocus=function() { 
products_price_return(id); };</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>...</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>id++;</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>}</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>the shown ID in the attribute works fine =&gt; 0, 1, 2, 
... X (let's say 10)</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>but when the function is called, the id always is the 
highest value at the end of for, f.e. 10</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005>how do these globals work, do i have to add them with a 
" + " or similar?</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=804061614-28092005></SPAN></FONT>&nbsp;</DIV></BODY></HTML>