[Pieforms-commit] SF.net SVN: pieforms: [267] pieforms-php5/trunk/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2007-12-31 12:16:09
|
Revision: 267 http://pieforms.svn.sourceforge.net/pieforms/?rev=267&view=rev Author: oracleshinoda Date: 2007-12-31 04:16:11 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Add the 'error' class to the form tag if the form has errors on it. This helps with autofocus right now, as the autofocus code can 'focus its efforts', so to speak, on forms with errors on them first. But it might also help application developers who are trying to style forms with errors on them. Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2007-12-31 12:15:51 UTC (rev 266) +++ pieforms-php5/trunk/src/pieform.php 2007-12-31 12:16:11 UTC (rev 267) @@ -521,7 +521,11 @@ * @return string */ public function get_form_tag() {/*{{{*/ - $result = '<form class="pieform"'; + $result = '<form class="pieform'; + if ($this->has_errors()) { + $result .= ' error'; + } + $result .= '"'; foreach (array('name', 'method', 'action') as $attribute) { $result .= ' ' . $attribute . '="' . $this->data[$attribute] . '"'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |