esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Hirsch <hirsch.d...@gmail.com>
Subject Modal Dialogs: Getting there
Date Wed, 24 Mar 2010 07:51:46 GMT
I just deployed a new version on stax.

If you look at
http://esmecloudserverapache.dickhirsch.staxapps.net/track_view/, you will
see my first attempts at creating modal dialog. Right now, I'm stuck on
submitting the dialog via jquery.

Here is the script (dialog_test.js). If anybody has any ideas how to solve
the problem that would be great.

$("#dialog-form").dialog({
            autoOpen: false,
            height: 200,
            width: 350,
            modal: true,
            buttons: {
                'Create a new track': function() {
                    var bValid = true;
                    allFields.removeClass('ui-state-error');

                    bValid = bValid &&
checkLength(tracking_input,"tracking_input",3,16);

                    bValid = bValid &&
checkRegexp(tracking_input,/^[a-z]([0-9a-z_])+$/i,"Track may consist of a-z,
0-9, underscores, begin with a letter.");

                    if (bValid) {
                         //$('button[type=submit] .default').click();
                         this.ownerDocument.forms[1].submit();

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message