Directly assign the path to the option in the drop-down menu, and use asp loop to output the static method: copy the following code into <body>~</body>
program code
<table cellpadding=2 width=226 cellspacing=2 border=0 >
<tr>
<td width=32 align=right><img id=idface src=..../../../bbs/images/icon/1.gif /><td width=30 ><font class=cha2> Avatar</font></td>
<td width=69>
<select class=editbox1 onChange=document.images['idface'].src=options[selectedIndex].value;>
<option value=../../../bbs/images/icon/1.gif selected>Avatar 1</option>
<option value=../../../bbs/images/icon/2.gif select>Avatar 2</option>
<option value=../../../bbs/images/icon/3.gif select>Avatar 3</option>
<option value=../../../bbs/images/icon/4.gif select>Avatar 4</option>
<option value=../../../bbs/images/icon/5.gif select>Avatar 5</option>
<option value=../../../bbs/images/icon/6.gif select>Avatar 6</option>
<option value=../../../bbs/images/icon/7.gif select>Avatar 7</option>
<option value=../../../bbs/images/icon/8.gif select>Avatar 8</option>
<option value=../../../bbs/images/icon/9.gif select>Avatar 9</option>
<option value=../../../bbs/images/icon/10.gif select>Avatar 10</option>
<option value=../../../bbs/images/icon/11.gif select>Avatar 11</option>
<option value=../../../bbs/images/icon/12.gif select>Avatar 12</option>
<option value=../../../bbs/images/icon/13.gif select>Avatar 13</option>
<option value=../../../bbs/images/icon/14.gif select>Avatar 14</option>
<option value=../../../bbs/images/icon/15.gif select>Avatar 15</option>
<option value=../../../bbs/images/icon/16.gif select>Avatar 16</option>
<option value=../../../bbs/images/icon/17.gif select>Avatar 17</option>
<option value=../../../bbs/images/icon/18.gif select>Avatar 18</option>
<option value=../../../bbs/images/icon/19.gif select>Avatar 19</option>
<option value=../../../bbs/images/icon/20.gif select>Avatar 20</option>
</select>
</td>
<td width=69>-->static</td>
</tr>
</table>
ASP array method: Copy the following code into <body>~</body>
program code
<table cellpadding=2 width=241 cellspacing=2 border=0 >
<tr>
<td width=32 align=right><img id=idface1 src=..../../../bbs/images/icon/1.gif /><td width=30 ><font class=cha2> Avatar</font></td>
<td width=62>
<select onChange=document.images['idface1'].src=options[selectedIndex].value; class=editbox1 >
<%
dim i
for i=1 to 20
%>
<option select value=../../../bbs/images/icon/<%=I%>.gif>Avatar<%=I%></option>
<%
next
%>
</select>
</td>
<td width=91> --> ASP array</td>
</tr>
</table>
Common points:
1. <img id=idface src=1.gif> // An ID number must be assigned to the default image.
2. <select onChange=document.images['idface'].src=options[selectedIndex].value;> // Then call this ID in the drop-down menu
...
</select>
Differences:
In the static production method:
program code
<select......>
<option value=1.gif > Avatar 1 </option> // Directly assign the path to the option in the drop-down menu
<option value=2.gif > Avatar 2 </option>
...
</select>
-------------------------------------------------- ----------------------------------
In the ASP array definition method:
program code
<select......>
<% dim i // define array i
for i=1 to 20 // Define the value of i to be 1~20
%>
<option select value=<%=I%>.gif>Avatar<%=I%></option> // Display the value of the first option
<% next %> // next item
</select>