Hi, this may be just me being bad at JS, but I got a dialog like this:

elm.dialog({
           resizable: false,    
           title: (caller.title) ? caller.title : formElement,
           buttons:{
            'Ok' : function() {
                    var form = $("#" + caller.nodeId + " form");
                    var options = {
                        'beforeSubmit': function (data, form, options) {
                            $(elm).dialog('close');
                            delete(data.id);
                            return true;
                        },
                        'url':getMenuItemSavePointer(caller._id),
                        'type' : 'POST',
                        'dataType': 'json',
                        'success': onMenuItemSaveDone
                     
                    };
                    form.ajaxSubmit(options);
                },
            'Close' : function() {
                $(this).dialog('destroy');
                }
                }}



Sometimes I want the 'Ok' text to be 'Save', other times I want it to be
"Delete". How can I use a variable as a key to a hash?

This is a bit a general JS quesion, I'm sorry for that, but I have tried
to research this and haven't come up with a good way to do it.

Regards,
Tarjei

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to