View Code
1 function myClick() {
2 var objDrp = document.getElementById('<% =ddlSP_TDEPT1.ClientID%>');
3
4 var ID = objDrp.options[objDrp.selectedIndex].value;
5 if (ID == "") {
6 alert("請選擇承辦單位!");
7 return false;
8 }
9
10 }
View Code
1 <asp:DropDownList ID="ddlSP_TDEPT1" DataTextField="Name" DataValueField="code" runat="server"> </asp:DropDownList>