Dim str_
tel2_ = "02"
tel = split(tel2_,"-")
tel_check = "02,031,032,033,041,042,043,051,052,053,054,055,061,062,063,064,070"
tel_ = split(tel_check,",")
For i=0 To UBound(tel, 1)
response.write "tel(" & i & ") 배열의 값 : " & tel(i) & "기타<br>"
If tel(0) = tel_(i) Then
response.write "tel(" & i & ") 배열의 값 : " & tel(i) & "if문<br>"
telsele = "selected"
Else
response.write "tel(" & i & ") 배열의 값 : " & tel(i) & "else<br>"
End if
Next
response.write "tel 배열의 값 : " & tel_(0) & "<br><br>"
-- 여기부터 시작 select 안의 내용 수정시 해당값 불러오기
response.write "<select name='tel1' id='tel1'>"
For i=0 To UBound(tel_)
response.write "<option value="&tel_(i)
If tel_(i) = "054" then
response.write " selected "
End If
response.write ">" &tel_(i)&"</option>"
Next
response.write "</select>"
-- 여기까지 위내용을 집어 넣으면 아래 내용을 간단히 할수 있다.
For i=0 To UBound(tel_)
If tel_(i) = "053" then
response.write "하나다<br>"
End If
'response.write If tel_(i) = &" 053 "& Then &" selecte "&End If
Next
' If tel_(i) = &" 053 Then selected end if%>
<select name="tel1" id="tel1">
<option value="02" <%=telsele%>>02</option>
<option value="031" <%=telsele%>>031</option>
<option value="032" <%=telsele%>>032</option>
<option value="033" <%=telsele%>>033</option>
<option value="041" <%=telsele%>>041</option>
<option value="042" <%=telsele%>>042</option>
<option value="043" <%=telsele%>>043</option>
<option value="051" <%=telsele%>>051</option>
<option value="052" <%=telsele%>>052</option>
<option value="053" <%=telsele%>>053</option>
<option value="054" <%=telsele%>>054</option>
<option value="055" <%=telsele%>>055</option>
<option value="061" <%=telsele%>>061</option>
<option value="062" <%=telsele%>>062</option>
<option value="063" <%=telsele%>>063</option>
<option value="064" <%=telsele%>>064</option>
<option value="070" <%=telsele%>>070</option>
</select>