tags:

views:

88

answers:

1
<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" Width="48px"   />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50px" OnClientClick="$find('popup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>

this is mycode. once i have witten some thing in textbox and i click 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 enterd value. so is there any way i can clear the value which i have entered in the textbox, using javascript, jQuery. i dnt want use a server side event for this which will do a post back event so

thank you

A: 

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;" />
Josh Stodola
Note: I am not sure what this `$find` function of yours is actually doing.
Josh Stodola
$find here is used to find the pop up control whichw e would like to hide or show
prince23
Well, you get the idea. Find the `txtName` control and set its value to "" when they click the cancel button. Simple as that.
Josh Stodola