title: emptying text field after user inserts data for next input
body: <p>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. </p>
  
  <p>jquery at my layout</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
  
              $.ajaxSetup({ cache: false });
  
              $(document).ready(function () {
                  $(".openDialog").live("click", function (e) {
                      e.preventDefault();
  
                      $("&lt;div&gt;&lt;/div&gt;")
                      .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");                    
                  });
              });
      &lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>This shows popup when i click a button to get input box</p>
  
  <p>below is my jquery in insert view</p>
  
  <pre><code>&lt;/script&gt;
   &lt;script type="text/javascript"&gt;
       $(function () {
           $('form').submit(function () {
                  $("#popUp").dialog(
               {
  
                   title: $(this).attr("data-dialog-title"),
                   minWidth: 500,
                   resizable: false,
  
                   modal: true,
  
                   buttons: {
                       Close: function () {
  
                           $(this).dialog("close");
  
                       }
                   }
  
  
  
               }
               );
  
           });
       });
  
  
      &lt;/script&gt;
  </code></pre>
  
  <p>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.</p>