PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Single page, multiple forms viewed within individual modal windows - not working

  1. Hello,

    I'm attempting to feature multiple G forms on a single page, hiding them until called into a modal window and have them set to use ajax. The problem is as follows:

    - Forms load OK but only the first form chosen will validate or submit when clicked. Other forms will appear, but text input will not function, nor does validation or submission of the form. This problem occurs regardless of whether the first-clicked form has been submitted successfully or not. How can I have the others function regardless of what happens to the first form?

    Posted 12 years ago on Thursday June 7, 2012 | Permalink
  2. Found the solution to my problem on Stack Overflow:

    By adding:

    close: function(event, ui) {
                            try {$("#diatom-carproof-form").data("validator").destroy();}catch(e){}
    						$(this).dialog("destroy").remove();
                        }

    to each form instance called in the detail-button.js within the application/views/inventory/js folder.

    I.E.:

    dealertrend('#yourtheme-yourformname').click(function() {
    
            dealertrend('#yourtheme-yourformname-form').dialog({
                autoOpen: true,
                height: 300,
                width: 529,
                modal: true,
    			close: function(event, ui) {
                            try {$("#yourtheme-yourformname-form").data("validator").destroy();}catch(e){}
    						$(this).dialog("destroy").remove();
                        }
            });
    
            return false;
    
        });
    Posted 12 years ago on Tuesday June 12, 2012 | Permalink
  3. David Peralty

    That is pretty brilliant and should help many people on this forum. Thanks for posting your solution.

    Posted 12 years ago on Tuesday June 12, 2012 | Permalink
  4. We are attempting to do the same thing with Bootstrap modals. Can anyone provide insight on how the above code would apply to those?

    I think it would have to go somewhere in here:

    $('#myModal').on('hidden', function () {
    // do something…
    })

    http://twitter.github.com/bootstrap/javascript.html#modals

    Posted 12 years ago on Tuesday July 10, 2012 | Permalink