Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:15:30+00:00 2026-06-15T06:15:30+00:00

i am opening a jquery dialog in a click function. But if i close

  • 0

i am opening a jquery dialog in a click function. But if i close the dialog and open it for the second time, the contents inside the dialog remains the same.. I need the text boxes inside the dialog to be empty while i open it for the consecutive times..

This is my aspx code:

<div>
<span id="id_PrivateSpace" style="color: #88b807; margin-left: 839px;
                            margin-top: -12px; cursor: pointer; display: block">Create</span>
</div>


<div id="thedialog" style="display: none; overflow: hidden">
                    <table id="table" style="border-spacing: 7px 7px; margin-left: 5px">
                        <tr>
                            <td>
                                <span class="SubHeading" style="font-size: 10pt;">Private Space Name </span>
                            </td>
                            <td>
                                <asp:TextBox ID="txt_spacename" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="SubHeading" style="font-size: 10pt;">Private Space Description </span>
                            </td>
                            <td>
                                <asp:TextBox ID="txt_spacedesc" TextMode="MultiLine" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="SubHeading" style="font-size: 10pt;">Users </span>
                            </td>
                            <td>

                                <input type="text" id="txt_users" />
                            </td>
                            <td>
                                <asp:Button ID="btn_addusers" Text="Add" Style="margin-left: 10px;" runat="server" />
                            </td>
                            <td rowspan="5">
                                <table id="users_grid" align="left">
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="SubHeading" style="font-size: 10pt;">DL </span>
                            </td>
                            <td>
                                <asp:TextBox ID="txt_Add_dl" TextMode="MultiLine" runat="server" />
                            </td>
                        </tr>
                    </table>
                    <input type="button" id="Btn_Submit" value="Create" style="margin-left: 335px; margin-top: 35px;"
                        runat="server" />
                </div>

This is my js code:

 $("#thedialog").dialog({
                autoOpen: false,
                title: 'Create Private space',
                modal: true,
                position: 'center',
                width: 900

            });


            $('#id_PrivateSpace').click(function() {
                $('#thedialog').dialog('open');
                return false;
            });

what should i add to refresh only the contents of the dialog?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:15:32+00:00Added an answer on June 15, 2026 at 6:15 am

    I guess you can try:

    $('#id_PrivateSpace').click(function() {
        $("#thedialog").find('input:text, textarea').val('').attr('placeholder','Enter some value');
        $("#thedialog").find('select').val('');//you need to have and option like <option value="">Please Select</option> in your select options list
        $('#thedialog').dialog('open');
        return false;
    }); 
    

    And for your aspx Dropdownlist make sure you set AppendDataBoundItems to true; and set the OnDataBinding event

    <asp:DropDownList id="myDdl" runat="server" OnDataBinding="Ddl_Databinding" >
    </asp:DropDownList>
    
    And in your code behind, Add:
    
    protected void Ddl_Databinding(object sender, EventArgs e)
    {
        DropDownList ddl = (DropDownList)sender;
        ddl.Items.Add(new ListItem("Please Select", ""));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using fancybox function in jquery. i am opening loign box on click
I have a jquery function and I need to call it after opening the
i am opening jQuery Dialog through the below code.The problem here is when i
I have JQuery UI Dialog opening on pressing CTRL + Q using the following
I am trying to open a modal jquery dialog using jquery 1.4 and jquery-ui-1.8rc3.custom.js
I see lot of example opening popup with jquery but don't see anything that
When i click on a link in my page, i am opening a jquery
I am placing some ASP.NET html elements(that upload a file) inside a JQuery Dialog.
I've implemented the following code for uploading photos inside a jQuery dialog (using an
I am using jQuery's modal dialog for opening a dialog containing a form. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.