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 8381751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:45:53+00:00 2026-06-09T16:45:53+00:00

I am using jquery that shows popup for input box. when the user inputs

  • 0

I am using jquery that shows popup for input box. when the user inputs data and submits i redirected action to the same insert action so that the text field can be refreshed.at first pop up for input is shown but when i submit the popup shown previous remained as it is and new pop up for the input box is shown in which the input box is refreshed everytime i click insert.how can I close the previous popup and show only new one. and also please explain ways to empty the the textbox after user inputs data so that he can input next data.

jquery at my layout

 <script type="text/javascript">

            $.ajaxSetup({ cache: false });

            $(document).ready(function () {
                $(".openDialog").live("click", function (e) {
                    e.preventDefault();

                    $("<div></div>")
                    .addClass("dialog")
                    .attr("id", $(this)
                    .attr("data-dialog-id"))
                    .appendTo("body")
                    .dialog({
                        title: $(this).attr("data-dialog-title"),
                        minWidth: 500,
                        minHeight: 100,
                        resizable: false,
                        close: function () { $(this).remove() },
                        modal: true
                    })

                    .load(this.href);
                });

                $(".close").live("click", function (e) {
                    e.preventDefault();
                    $(this).closest(".dialog").dialog("close");                    
                });
            });
    </script>
</head>

This shows popup when i click a button to get input box

below is my jquery in insert view

</script>
 <script type="text/javascript">
     $(function () {
         $('form').submit(function () {
                $("#popUp").dialog(
             {

                 title: $(this).attr("data-dialog-title"),
                 minWidth: 500,
                 resizable: false,

                 modal: true,

                 buttons: {
                     Close: function () {

                         $(this).dialog("close");

                     }
                 }



             }
             );

         });
     });


    </script>

this shows popup for the actions that is performed from this page. ie for error message and insert another user form. Hence the popup is generated from the layout view and again next popup from insert view.I am trying to close popup from layout view when the popup from insert view is generated or some way to clear the text field in insert view without showin second popup.What should i do.

  • 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-09T16:45:55+00:00Added an answer on June 9, 2026 at 4:45 pm

    This is the line you want in the code below. I put it inline with a comment to denote but I’ll put it here too for easy finding: $(this).find("input").val("");

        $('form').submit(function () {
                $("#popUp").dialog(
             {
    
                 title: $(this).attr("data-dialog-title"),
                 minWidth: 500,
                 resizable: false,
    
                 modal: true,
    
                 buttons: {
                     Close: function () {
                         //This line below is what you need to clear the field
                         $(this).find("input").val("");
                         $(this).dialog("close");
    
                     }
                 }
    
    
    
             }
             );
    
         });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ajax control that is loaded into a Yahoo popup using jQuery.
I'm using jQuery impromptu to show a popup box tour on my site (Example
I'm using jquery colorbox to popup user accounts in a window. I also have
I am using jquery so that when an image is hovered over, a popup
I have some DIVs that I am using JQuery to hide and show using
Is there a way using JQuery that i can detect when a div starts
I am writing a site using jquery that repeatedly calls $(window).width() and $(window).height() to
How can I select elements (using jQuery) that do not contain any elements? For
A while back I created a lightbox plugin using jQuery that would load a
So I'm using some jQuery that I found online. There's a lot of variations

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.