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

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Accustom
Posts: 5
Joined: Fri Jul 21, 2023 11:39 pm

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

Post 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
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

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

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Accustom
Posts: 5
Joined: Fri Jul 21, 2023 11:39 pm

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

Post 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! :-)
Post Reply