diff --git a/jquery.xmleditor.js b/jquery.xmleditor.js
index 6bf2bbe..3306306 100644
--- a/jquery.xmleditor.js
+++ b/jquery.xmleditor.js
@@ -2211,24 +2211,27 @@ ModifyMenuPanel.prototype.initialize = function (parentContainer) {
if (self.editor.submitButtonConfigs != null){
$.each(self.editor.submitButtonConfigs, function(index, config){
- if (!('createDomElement' in config) || config.createDomElement){
- var submitButton = $("").attr({
+ var submitButton;
+ if (config.id && ('createDomElement' in config) && !config.createDomElement) {
+ submitButton = $("#" + config.id);
+ } else {
+ submitButton = $("").attr({
id : config.id,
'type' : 'button',
'class' : config.cssClass || submitButtonClass,
name : config.name || 'submit',
value : config.label || 'Submit'
}).appendTo(documentStatusPanel);
+ }
- if (!('responseHandler' in config) && config.url) {
- config.responseHandler = this.options.submitResponseHandler
- || this.swordSubmitResponseHandler;
- }
-
- submitButton.click(function() {
- self.editor.submitXML(config);
- });
+ if (!('responseHandler' in config) && config.url) {
+ config.responseHandler = this.options.submitResponseHandler
+ || this.swordSubmitResponseHandler;
}
+
+ submitButton.click(function() {
+ self.editor.submitXML(config);
+ });
});
}
documentStatusPanel.appendTo(this.menuColumn);
diff --git a/src/modify_menu_panel.js b/src/modify_menu_panel.js
index a7917cd..fef52d6 100644
--- a/src/modify_menu_panel.js
+++ b/src/modify_menu_panel.js
@@ -21,24 +21,27 @@ ModifyMenuPanel.prototype.initialize = function (parentContainer) {
if (self.editor.submitButtonConfigs != null){
$.each(self.editor.submitButtonConfigs, function(index, config){
- if (!('createDomElement' in config) || config.createDomElement){
- var submitButton = $("").attr({
+ var submitButton;
+ if (config.id && ('createDomElement' in config) && !config.createDomElement) {
+ submitButton = $("#" + config.id);
+ } else {
+ submitButton = $("").attr({
id : config.id,
'type' : 'button',
'class' : config.cssClass || submitButtonClass,
name : config.name || 'submit',
value : config.label || 'Submit'
}).appendTo(documentStatusPanel);
+ }
- if (!('responseHandler' in config) && config.url) {
- config.responseHandler = this.options.submitResponseHandler
- || this.swordSubmitResponseHandler;
- }
-
- submitButton.click(function() {
- self.editor.submitXML(config);
- });
+ if (!('responseHandler' in config) && config.url) {
+ config.responseHandler = this.options.submitResponseHandler
+ || this.swordSubmitResponseHandler;
}
+
+ submitButton.click(function() {
+ self.editor.submitXML(config);
+ });
});
}
documentStatusPanel.appendTo(this.menuColumn);