[Pieforms-commit] SF.net SVN: pieforms: [150] pieforms-php5/trunk/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2006-12-27 05:37:33
|
Revision: 150 http://svn.sourceforge.net/pieforms/?rev=150&view=rev Author: oracleshinoda Date: 2006-12-26 21:37:33 -0800 (Tue, 26 Dec 2006) Log Message: ----------- Removed some comments from the javascript output for jsform submissions, comments aren't needed (later on this stuff might be packed). Added a bit of code to handle expanding a fieldset if it contains elements with errors in them. Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-27 05:27:58 UTC (rev 149) +++ pieforms-php5/trunk/src/pieform.php 2006-12-27 05:37:33 UTC (rev 150) @@ -895,33 +895,33 @@ $result .= <<<EOF } else { - // Redirect if the form is being cancelled if (data.returnCode == -2) { window.location = data.message; return; } - // Set errors if there are any {$this->name}_remove_all_errors(); if (data.message.errors) { for (error in data.message.errors) { {$this->name}_set_error(data.message.errors[error], error); } + // @todo only output when fieldsets are present + forEach(getElementsByTagAndClassName('fieldset', 'collapsed', '{$this->name}'), function(fieldset) { + if (getFirstElementByTagAndClassName(null, 'error', fieldset)) { + removeElementClass(fieldset, 'collapsed'); + } + }); } if (data.returnCode == -1) { - // The request failed validation EOF; - - // @todo: renumber the PIEFORM_* flags to be 0, -1, -2 to allow users to have the positive numbers to themselves if (!empty($this->data['jserrorcallback'])) { $result .= " {$this->data['jserrorcallback']}('{$this->name}', data);\n"; } $result .= <<<EOF } else { - // A return code we don't know about EOF; if (!empty($this->data['globaljserrorcallback'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |