开发者

how to reset the control values inside the modal pop up using Javascript or Jquery?

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="popup" TargetControlID="cmdTrigger" 
            PopupControlID="pnlPopup" BackgroundCssClass="modalBackground"
            OkControlID="btnOk" >
    </cc1:ModalPopupExtender>  
    <asp:Panel ID="pnlPopup" runat="server" CssClass="modalpopup" Style="display: none">
        <div class="container">
            <div class="header">
                <asp:Label ID="Label1" runat="server" CssClass="msg" Text="Add a new Entry" />
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="$find('popup').hide(); return false;" />
            </div>
            <div class="body">
                <asp:Label ID="Label2" runat="server" CssClass="msg" Text="Name" />
                <asp:TextBox ID="txtName" runat="server" Width="346px"></asp:TextBox>
                </div>
            <div class="footer">
                <asp:Button ID="btnOk" runat="server" Text="Save开发者_JS百科" Width="48px"   />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50px" OnClientClick="$find('popup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>

This is my code. Once I have written some thing in textbox and I click the cancel button, by which the pop up window will close. If I try to open the pop up window again, the textbox will still hold its previous entered value. so is there any way I can clear the value which I have entered in the textbox, using Javascript, jQuery. I don't want to use a server side event for this which will do a post back event so what are my options?


Clear the textbox when you click cancel...?

<asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50px"
   OnClientClick="$find('txtName').value = '';
                  $find('popup').hide();
                  return false;" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜