From eb33688d88b9b46eda0ff4a14f822e3e64b732b7 Mon Sep 17 00:00:00 2001 From: Hector Cortez Date: Mon, 28 Jan 2013 12:11:34 -0400 Subject: [PATCH] BUG 9886 Duplicated cases when clicking various times in the submit ...SOLVED - For some reason when you click various times in the submit button, it will create a duplicate case. - Disabled Button after clicked. --- gulliver/system/class.xmlform.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 9e56705df..9a5608e39 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -3240,10 +3240,13 @@ class XmlForm_Field_Submit extends XmlForm_Field public function render ($value = null, $owner = null) { $onclick = G::replaceDataField( $this->onclick, $owner->values ); + if ($onclick != '') { + $onclick = "this.disabled=true;" . $onclick; + } if ($this->mode === 'edit') { // if ($this->readOnly) // return 'label .'\' disabled/>'; - return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : 'onclick="this.disabled=true;");\'') . " />"; } elseif ($this->mode === 'view') { //return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; //$sLinkNextStep = 'window.open("' . $owner->fields['__DYNAFORM_OPTIONS']->xmlMenu->values['NEXT_STEP'] . '", "_self");';