我的页面有个dropdownlist,一个确定按钮。dropdownlist可选择批准或者拒绝,现在要求当选择批准然后点击确定按钮时要提示是否批准?当用户点击弹框中的确认按钮将会被批准,取消则取消审批操作。当选择拒绝然后点击确定按钮时要提示是否拒绝?当用户点击弹框中的确认按钮将会被拒绝,取消则取消审批操作。
这个弹框提示要怎么做?
我知道在页面中的Load可以这样写: btn_next.Attributes.Add( "onclick", "javascript:return confirm('XXXX')" );但是弹出的框怎么判断我是批准操作还是拒绝操作呢?
------解决方案--------------------------------------------------------
这个简单:不知道是不是楼主想要的!
- C# code
<asp:DropDownList ID="ddlTest" runat="server"> <asp:ListItem Text="批准" Value="a" ></asp:ListItem> <asp:ListItem Text="拒绝" Value="b"></asp:ListItem> </asp:DropDownList> $(document).ready(function () { $("#<%=ddlTest.ClientID %>").bind("change", function () { //alert($("#<%=ddlTest.ClientID %>").val()); if ($("#<%=ddlTest.ClientID %>").val() == "a") { alert("批准操作"); } else { alert("拒绝操作"); } });</script>
------解决方案--------------------------------------------------------
加个提示return confirm("确认要删除吗?");
------解决方案--------------------------------------------------------