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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:11:10+00:00 2026-06-04T07:11:10+00:00

This jquery ui dialog is filled with html and form values from an ajax

  • 0

This jquery ui dialog is filled with html and form values from an ajax call (works). I want to close or submit it and then reopen and reuse it just the same. I can close and reopen fine but it has the old values still there and then the new ones are added. It keeps adding the html values after each close and reopen. There are many questions about this on SO but I don’t see a clear answer. I have tried close, empty, destroy but the combination isn’t working the way I need it. Any ideas?

$("#StoreForm").dialog({
    autoOpen:false, 
    width:500, 
    height:900, 
    modal:true,
    buttons: { 
   OK: function() { 
   $('#StoreForm').dialog('close'); 
$(this).dialog('hide');
$(this).dialog('empty'); 
 }, 
 'Save': function() { 
  $(this).dialog('empty'); 
 } 

 }

 });


 //additional code to click and open the dialog

 $(".sel").unbind('click');
 $(".sel").on("click", function(e){
e.preventDefault();                 
 $("#StoreForm").dialog('open');
 var valueSelected = $(this).closest('tr').children('td.item').text();                                  
$.ajax({
url: 'query/categories.cfc',
dataType: 'json',
cache: false,
data: {method: 'getProductInfo', 
                                queryFormat: 'column',
                            returnFormat: 'JSON',
productID:   valueSelected

},
success: function(response, status, options){
$("#PROD_SUPER_ID").val(response.DATA.PROD_SUPER_ID[0]);

$("#color").val(response.DATA.COLOR_ATTRIB);

                            $("#SIZE_ATTRIB").val(response.DATA.SIZE_ATTRIB);

$("#price").val(response.DATA.PRICE);
var w = [];
w.push("<p>", response.DATA.ICON[0], "</p>", "<p>", 
      response.DATA.FULL_DESCRIPTION [0], "</p>") 
                            $("#StoreForm").prepend(w.join(""));
  • 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-04T07:11:10+00:00Added an answer on June 4, 2026 at 7:11 am

    What I found was you can close the dialog and empty the html and it will clear this type of dialog set-up. For reopening I nested the 2nd ajax call in the success response of the initial one..

     //set up dialog with options
    
    $("#StoreForm").dialog({
    autoOpen: false,
    width: 500,
    height: 500,
    modal: true,
    buttons: {
        Cancel: function(){
    
            $('#StoreForm').dialog('close');
            $('#StoreForm').html("");
    
        },
    
    //pop-up individual items
    
        "Add to Cart": function(){
                $.ajax({
                url: $("#storeCart").attr('action'),
                data: $("#storeCart").serializeArray(),
                type: 'POST',
                success: function(response){
    
                      var name = $( "#name" ),
        email = $( "#email" ),
        password = $( "#password" ),
        allFields = $( [] ).add( name ).add( email ).add( password ),
        tips = $( ".validateTips" );
    
    if you have any questions please respond. Thanks
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add some custom HTML between the buttons on a jQuery dialog
I have a problem with using jQuery Dialog and Ajax submit in JSF. I
I've been working on a simple JQuery dialog form that loads in via AJAX.
I am using jquery dialog() so a popup comes up. I want to call
$('.ui-dialog-titlebar-close ui-corner-all').hide(); this is the hide for my Jquery dialog close 'X' span.. this
I want to close the jquery dialog on click of a button which is
This script opens a jQuery dialog/modal to request verification prior to submitting the form,
I have a jquery dialog with a nested form like this: <!-- Store Location
We have this JQuery code: $('#dialog-message').attr(title, t); It works fine the first time it's
How would I call this jquery function from my code behind page. Im clueless

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.