<select name="strYear" id="strYear" onchange="document.form1.submit();">
<option <% if strYear=Year(Now()) then Response.Write(" selected='selected'") %>><%=Year(Now())+543%></option>
<option <% if strYear=Year(Now())+1 then Response.Write(" selected='selected'") %>><%=Year(Now())+544%></option>
</select>
ตัวอย่าง เลือกปีที่จะ Query ข้อมูล
Date :
2013-04-12 10:42:08
By :
phumpinyo
No. 3
Guest
Code (ASP)
<select name="strYear" id="strYear" onchange="document.form1.submit();">
<option <% if request("strYear")=Year(Now()) then Response.Write("selected") %>><%=Year(Now())+543%></option>
<option <% if request("strYear")=Year(Now())+1 then Response.Write("selected") %>><%=Year(Now())+544%></option>
</select>