Examples of creating dynamic html combobox with Asp .de For loop. You can use the following examples to create html combobox dynamically with Asp. With this code, we use the For loop to generate html combobox between 1423 and 1423.


<%
'// Your age
Response.Write ("" & vbCrLf)
Response.Write ("Your Age" & vbCrLf)
For i = Clng (Year (Date ()) - 14) To 1923 Step -1
Response.Write ("" & i & "" & vbCrLf)
Next
Response.Write ("" & vbCrLf)
%>

Here we create html combobox, which we can choose from 210 cm to 120 cm in length with 5 cm intervals.


<%
'// Your length
Response.Write ("" & vbCrLf)
Response.Write ("Your height" & vbCrLf)
For i = 210 To 120 Step -5
Response.Write ("" & i & "cm" & vbCrLf)
Next
Response.Write ("" & vbCrLf)
%>

Here again with the For loop starting from 35 up to 120 html combobox are created.


<%
'// Your Weight
Response.Write ("" & vbCrLf)
Response.Write ("Your Weight" & vbCrLf)
For i = 35 To 120
Response.Write ("" & i & "kg" & vbCrLf)
Next
Response.Write ("" & vbCrLf)
%>