From 89e165ace9fa19985e2115f29e60615ebfd49c9b Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 10 Dec 2014 12:52:06 -0600 Subject: [PATCH] forms: Validate fields like the thread-entry --- include/class.forms.php | 2 +- include/staff/templates/dynamic-form.tmpl.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/class.forms.php b/include/class.forms.php index 0edab5b9d..02758818d 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -93,7 +93,7 @@ class Form { if (!$this->_clean) { $this->_clean = array(); foreach ($this->getFields() as $key=>$field) { - if ($field->isPresentationOnly()) + if (!$field->hasData()) continue; $this->_clean[$key] = $this->_clean[$field->get('name')] = $field->getClean(); diff --git a/include/staff/templates/dynamic-form.tmpl.php b/include/staff/templates/dynamic-form.tmpl.php index 1be98b962..b0a3d7d47 100644 --- a/include/staff/templates/dynamic-form.tmpl.php +++ b/include/staff/templates/dynamic-form.tmpl.php @@ -89,8 +89,7 @@ if (isset($options['entry']) && $options['mode'] == 'edit') { ?> <?php } foreach ($field->errors() as $e) { ?> - <br /> - <font class="error"><?php echo Format::htmlchars($e); ?></font> + <div class="error"><?php echo Format::htmlchars($e); ?></div> <?php } ?> </div></td> </tr> -- GitLab