HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Custom Error Message


#1

Hello,

I wonder if its possible to change the error Messages you get when leaving a required field empty. Something more specific than “Required Field”? Cant find anything in the documentation or forums. Thanks in advance.

Chris


#2

Hi Christian,

Are you referring to in the portal or the request screen?


#3

Hi Ian,

its a custom request.tpl.

Chris


#4

On the portal you’d have to capture this output instead of just echo’ing it:

$this->helper->showError(‘sEmail’,’
’)

so check if it’s not empty, if it isn’t it’s an error and output your own text instead.

(!empty($this->helper->showError(‘sEmail’,’
’)) ? ‘error msg’ : ‘’)

should do it, you need to replace sEmail for each field as appropriate


#5

Hey Ian,

thx this will do it. One more thing there is a standard message at the top when an error is triggered. Is there a way to remove this message?

Chris


#6

Yes, removing this line should do it:

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