HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Customizing errors on required fields


#1

is it possible to customize the error text for required fields? And also, is it possible to move or create a new error at the top of the request form indicating to the user that not all required fields have been filled out?
We have many users submitting requests and a lot of custom fields for them to fill out. And unless they scroll down, they won’t know that there is missing required information.


#2

Hi Michael,

Yes, the basic way tot move them to the top are to move these error blocks to the top (or copy them so they’re in both places):

<?php echo $this->helper->showError('fullname','
') ?>

Now you’ll need a little more logic, like having a loop for the custom fields and so on so you’d probably need someone familiar with PHP to do it, but it shouldn’t be too hard. The template to edit is request.tpl.php and more details on how to edit are here: http://www.userscape.com/helpdesk/index.php?pg=kb.page&id=9


#3

I figured that was the line, but is there a way to modify the text of the error message?


#4

You could modify it in the language file, but I think it’s probably easier and better to check the return value of this line and do what you like with it. For instance:

if($this->helper->showError(‘fullname’)){
echo ‘My own error message’;
}