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

  • SEARCH
  • Home
  • 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 543905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:35:57+00:00 2026-05-13T10:35:57+00:00

I succeed in creating a sortable portlet system for a existing CMS. I also

  • 0

I succeed in creating a sortable portlet system for a existing CMS.
I also made a dialog popup where I can change true a form the title and in the future some more content within the dialog for each portlet.

However, my issue is that the #dialog shows the form inside my page before I click the icon.
When I click the icon, the form is removed from the page and shows nicely inside the dialog.
I understand why it does that, but I can’t solve it.

Here’s my JavaScript:

          $('.column .portlet-header .ui-icon-wrench').click(function(e) {
        e.preventDefault();
          var portlet_to_edit = $(this).parents('.portlet').attr('id');


                //dialog                
                               //  alert($(this).parents('.portlet').attr('id'));
                                $("#dialog").dialog({ 
                                                      bgiframe: true,
                                                      autoOpen: false,
                                                      height: 300,
                                                      modal: true,

                                                        buttons: {
                                'Save block': function() {
                                var bValid = true;
                    allFields.removeClass('ui-state-error');

                    bValid = bValid && checkLength(name,"username",3,16);
                    bValid = bValid && checkRegexp(name,/^[a-z]([0-9a-z_])+$/i,"Username may consist of a-z, 0-9, underscores, begin with a letter.");



                               if (bValid) {

                                $.ajax({
                                type: "POST",
                                url: "server_items_reorder.php",
                                data: 'tid=' + portlet_to_edit + '&title=' + name.val()
                                      });
                                        $(this).dialog('close'); 
                                        $('.portlet').sortable('refresh') //not work?
                                        }

                                 },
                                Cancel: function() {
                                $(this).dialog('close');
                                  }
                                 },
                                 close: function() {
                                 //allFields.val('').removeClass('ui-state-error');
                                }
                          })
                $('#dialog').dialog('open');
            }); 

I know that it should be something like this (jQuery sample):

$("#dialog").dialog({
            bgiframe: true,
            autoOpen: false,
            height: 300,
            modal: true,
            buttons: {
                'Create an account': function() {
                    var bValid = true;
                    allFields.removeClass('ui-state-error');

                    bValid = bValid && checkLength(name,"username",3,16);
                    bValid = bValid && checkLength(email,"email",6,80);
                    bValid = bValid && checkLength(password,"password",5,16);

                    bValid = bValid && checkRegexp(name,/^[a-z]([0-9a-z_])+$/i,"Username may consist of a-z, 0-9, underscores, begin with a letter.");
                    // From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
                    bValid = bValid && checkRegexp(email,/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,"eg. ui@jquery.com");
                    bValid = bValid && checkRegexp(password,/^([0-9a-zA-Z])+$/,"Password field only allow : a-z 0-9");

                    if (bValid) {
                        $('#users tbody').append('' +
                            '' + name.val() + '' + 
                            '' + email.val() + '' + 
                            '' + password.val() + '' +
                            ''); 
                        $(this).dialog('close');
                    }
                },
                Cancel: function() {
                    $(this).dialog('close');
                }
            },
            close: function() {
                allFields.val('').removeClass('ui-state-error');
            }
        });



        $(''.column .portlet-header .ui-icon-wrench'').click(function() {
            $('#dialog').dialog('open');
        })
   

But then the function does not update my $.ajax.

  • 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-05-13T10:35:57+00:00Added an answer on May 13, 2026 at 10:35 am

    If I understand your problem correctly, I think you just need

    <div id="dialog" style="display: none;">
    
    // form here
    </div>
    

    so that when the page initially loads, the dialog and form will be hidden until needed.

    Edit: and to get the sortable to reload from ajax

    if (bValid) {
        $.ajax({
          type: "POST",
          url: "server_items_reorder.php",
          data: 'tid=' + portlet_to_edit + '&title=' + name.val(),
          success: function() { $('.portlet').sortable('refresh'); }
        });
        $(this).dialog('close'); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an actionscript project in Flex Builder. I succeed to export from Flash
By creating datastore models that inherit from the Expando class I can make my
Can someone explain this result to me. The first test succeeds but the second
I have an ASP.NET application which tracks statistics by creating and writing to custom
How can an automatic installer for .NET 2.0 application be created for Windows 98?
I assume I am not the first one having this problem and I am
I have to create a user in a third party application that stores its
I have successfully run NPRuntime plugin on webpage by copying it to firefox plugin
I'm writing a WinForms app which has two modes: console or GUI. Three projects
I am using the FTPClient library from Apache and cannot figure out a simple

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.