开发者

asp:DropDownList

开发者 https://www.devze.com 2023-01-23 08:44 出处:网络
The following code works except the dropdown list is not returned to its original value when the validation fails any ideas?

The following code works except the dropdown list is not returned to its original value when the validation fails any ideas?

 <tr><td valign="top" style="padding-right: 10px;">
                            &nbsp;&nbsp;<b>Select Account:</b>
                            &nbsp;&nbsp;&nbsp;&nbsp;<asp:DropDownList ID="m_lstAccounts" runat="server" CausesValidation="true"  ValidationGroup="Group1" 
                            CssClass="dropdownList" OnSelectedIndexChanged="OnAccountChange" AutoPostBack="True"></asp:DropDownList>
                            <br />
                        <script type="text/javascript">
                            function ConfirmDropDownValueChange(source, arguments) {
                                if (document.all("AccountProfileDirty").value == "1") {
                                    arguments.IsValid = confirm("Are you sure you want to continue with out saving?");
                                    source.
                                }
                                else {
                                    arguments.IsValid = true;
                                }
                            } 
                        </script> 
                        <asp:Custom开发者_如何学运维Validator ID="ConfirmDropDownValidator" runat="server" 
                            ClientValidationFunction="ConfirmDropDownValueChange" Display="Dynamic" ValidationGroup="Group1"  /> </td> </tr>


What is the random source. in the middle of your ConfirmDropDownValueChange() function? That would certainly make JavaScript fail.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号