|
|
|
เอา Code ASP.Net มาฝาก button get dropdown value ด้วย javascript |
|
|
|
|
|
|
|
ใครมี วิธีที่ดีกว่านี้นำด้วยนะครับ ผม ^^
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="test()"/>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="sdasd">asdsada</asp:ListItem>
<asp:ListItem Value="dasdas">asdas</asp:ListItem>
<asp:ListItem Value="dasdasd">asdsa</asp:ListItem>
<asp:ListItem Value="dasdasd">adas</asp:ListItem>
<asp:ListItem Value="asda">adasd</asp:ListItem>
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
</div>
<script>
function test() {
var e = document.getElementById("<%=DropDownList1.ClientID%>");
//var strUser = e.options[e.selectedIndex].value;
alert(e.value);
mypopup = window.open('Default.aspx?carid=' + e.value, 'mypopup', 'nenuber=no,toorlbar=no,location=no,scrollbars=no, status=no,resizable=no,width=180,height=180,top=220,left=650 ');
mypopup.focus();
}
</script>
</form>
Tag : ASP.NET HTML/CSS, JavaScript, Web (ASP.NET)
|
ประวัติการแก้ไข 2013-10-12 22:53:41
|
|
|
|
|
Date :
2013-10-12 22:52:53 |
By :
thewinner55 |
View :
936 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2013-10-13 10:39:03 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|