Skip to content
Snippets Groups Projects
Commit 89e165ac authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Validate fields like the thread-entry

parent 6f88c0da
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,7 @@ class Form { ...@@ -93,7 +93,7 @@ class Form {
if (!$this->_clean) { if (!$this->_clean) {
$this->_clean = array(); $this->_clean = array();
foreach ($this->getFields() as $key=>$field) { foreach ($this->getFields() as $key=>$field) {
if ($field->isPresentationOnly()) if (!$field->hasData())
continue; continue;
$this->_clean[$key] = $this->_clean[$field->get('name')] $this->_clean[$key] = $this->_clean[$field->get('name')]
= $field->getClean(); = $field->getClean();
......
...@@ -89,8 +89,7 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?> ...@@ -89,8 +89,7 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?>
<?php <?php
} }
foreach ($field->errors() as $e) { ?> foreach ($field->errors() as $e) { ?>
<br /> <div class="error"><?php echo Format::htmlchars($e); ?></div>
<font class="error"><?php echo Format::htmlchars($e); ?></font>
<?php } ?> <?php } ?>
</div></td> </div></td>
</tr> </tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment