[Pieforms-commit] SF.net SVN: pieforms: [264] pieforms-php5/trunk/src/static/core/pieforms.js
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2007-12-31 12:14:48
|
Revision: 264 http://pieforms.svn.sourceforge.net/pieforms/?rev=264&view=rev Author: oracleshinoda Date: 2007-12-31 04:14:53 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Ensure that, once the form has been submitted once, the new submit buttons are wired up again so the one that is clicked next time can be detected. Modified Paths: -------------- pieforms-php5/trunk/src/static/core/pieforms.js Modified: pieforms-php5/trunk/src/static/core/pieforms.js =================================================================== --- pieforms-php5/trunk/src/static/core/pieforms.js 2007-12-31 12:14:23 UTC (rev 263) +++ pieforms-php5/trunk/src/static/core/pieforms.js 2007-12-31 12:14:53 UTC (rev 264) @@ -35,9 +35,7 @@ this.init = function() { connect(self.data.name, 'onsubmit', self.processForm); - forEach(self.data.submitButtons, function(buttonName) { - connect(self.data.name + '_' + buttonName, 'onclick', function() { self.clickedButton = this; }); - }); + self.connectSubmitButtons(); } this.processForm = function(e) { @@ -84,6 +82,8 @@ // javascript references being lost replaceChildNodes($(self.data.name), tmp.childNodes[0].childNodes); + self.connectSubmitButtons(); + if (data.returnCode == 0) { // Call the defined success callback, if there is one if (typeof(self.data.jsSuccessCallback) == 'string' @@ -137,6 +137,12 @@ } } + this.connectSubmitButtons = function() { + forEach(self.data.submitButtons, function(buttonName) { + connect(self.data.name + '_' + buttonName, 'onclick', function() { self.clickedButton = this; }); + }); + } + // A reference to the iframe that submissions are made through this.iframe = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |