osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go
get it now
Move location of red required asterisk in form?
osTicket v1.9.8.1
I'd like to move the required red asterisk in the form to the right of the field label colon ( Full Name: * ) instead of after the box. I've tried hacking the dynamic-form.tmpl.php page by moving line 33, but then all the fields have the asterisk, even if they're not required. Anybody have a fix?
Thanks!
<?php
// Form headline and deck with a horizontal divider above and an extra
// space below.
// XXX: Would be nice to handle the decoration with a CSS class
?>
<tr><td colspan="2"><hr />
<div class="form-header" style="margin-bottom:0.5em">
<h3><?php echo Format::htmlchars($form->getTitle()); ?></h3>
<em><?php echo Format::htmlchars($form->getInstructions()); ?></em>
</div>
</td></tr>
<?php
// Form fields, each with corresponding errors follows. Fields marked
// 'private' are not included in the output for clients
global $thisclient;
foreach ($form->getFields() as $field) {
if (!$field->isVisibleToUsers())
continue;
?>
<tr>
<?php if ($field->isBlockLevel()) { ?>
<td colspan="2">
<?php
}
else { ?>
<td><label for="<?php echo $field->getFormName(); ?>" class="<?php
if ($field->get('required')) echo 'required'; ?>">
<?php echo Format::htmlchars($field->get('label')); ?>:</label></td><td>
<?php
}
$field->render('client'); ?>
<?php if ($field->get('required')) { ?>
<font class="error">*</font>
<?php
}
if ($field->get('hint') && !$field->isBlockLevel()) { ?>
<br /><em style="color:gray;display:inline-block"><?php
echo Format::htmlchars($field->get('hint')); ?></em>
<?php
}
foreach ($field->errors() as $e) { ?>
<br />
<font class="error"><?php echo $e; ?></font>
<?php }
$field->renderExtras('client');
?>
</td>
</tr>
<?php
}
?>
Comments
<font class="error">*</font>
Not perfect, but at least the form looks cleaner than having the red asterisks floating at the end of the boxes with no visual connection to the field labels. :-|