Page 1 of 1

Show error message when a certain number of characters is not matched.

Posted: Sat Jul 22, 2023 12:06 am
by Accustom
Hi,

is there a simple way to show an error message and refuse a commited ticket, if a certain number of characters for describing the issue is not matched?
This would be useful to get rid of improper tickets, that are not descibed well enough.

regards

Re: Show error message when a certain number of characters is not matched.

Posted: Sat Jul 22, 2023 8:19 am
by Klemen
No built-in way, but you could for example add something like this to your submit_ticket.php file:

1. backup existing files
2. open file submit_ticket.php in Notepad++ or some other powerful text editor
3. find

Code: Select all

// Is category a valid choice?
4. just ABOVE that code add something lile

Code: Select all

if (strlen($tmpvar['message']) < 100) {
    $hesk_error_buffer['message'] = 'Please describe your issue in more detail (at least 100 chars)';
}
5. save, upload and test

Re: Show error message when a certain number of characters is not matched.

Posted: Sat Jul 22, 2023 10:00 am
by Accustom
Wow i didn't think that would be that simple! That speaks for a very well designed software achitecture.

Thank you very much for your help! :-)