I have some code looking like this in JavaScript:
Now I'm writing an ASP.Net application which use server controls. How can I make some automated content like using "For..." in JavaScript?Code:<script language="JavaScript"><!-- for (i=1;i<11;i++){ document.write('<tr>'); document.write('<td><select name="komp' +i+ '" style="WIDTH: 125px" onclick="click_komp();">'); document.write('<% Do While Not Rs1.EOF %>'); document.write('<option value="<%=rs1.fields(0).value%>"><%=rs1.fields(2).value%></option>'); document.write('<%Rs1.MoveNext()%>'); document.write('<%Loop%>'); document.write('</select>'); document.write('</td>'); document.write('<td><select name="dimen' +i+ '" onclick="saet_dim' +i+ '();">'); document.write('<option selected value="none"> </option>'); document.write('</select>'); document.write('</td>'); document.write('<td><select name="serie' +i+ '" onclick="calc_serie();">'); document.write('<% Do While Not Rs7.EOF %>'); document.write('<option value="<%=rs7.fields(0).value%>"><%=rs7.fields(1).value%></option>'); document.write('<%Rs7.MoveNext()%>'); document.write('<%Loop%>'); document.write('</select>'); document.write('</td>'); document.write('<td><input type="text" name="kappedim' +i+ '" class="resfelt" size="3" value="90" readonly></td>'); //document.write('<td><input type="text" name="prisMedie' +i+ '" class="tastfelt" size="3" value="4,54" ></td>'); //document.write('<td><input type="text" name="prisPeh' +i+ '" class="tastfelt" size="3" value="7,00"></td>'); document.write('</tr>'); } //--></script>




Reply With Quote