Restricting Customized Field

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
SupportCenter
Posts: 65
Joined: Sat Aug 15, 2009 9:38 pm

Restricting Customized Field

Post by SupportCenter »

We're using version 2.1 of Help Desk.

We would like to know if there's any way of restricting a customized field to only one option in a text box. We have a support site and buyer's must type in the word YES stating they have read the policies. Once again we've received idiot people who have placed other items inside this box.

Currently we have restricted the box to 3 positions. Is there anyway to set up a field that says that customized field must equal YES.

So far we have changed it to a drop down box with two options of YES and YES, but we would like to have it so that the buyer physically types in YES into the customized text field. If they dont they cannot complete the ticket.

Thanks very much K for all your help.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Restricting Customized Field

Post by Klemen »

In the submit_ticket.php try adding this code

Code: Select all

if (strtoupper($custom1) != 'YES')
{
	$hesk_error_buffer[]='You need to type <b>YES</b> into the Agree to terms? box.';
}
just ABOVE

Code: Select all

if (count($hesk_error_buffer)!=0)
In the code change $custom1 to $customID where ID is the number of the custom field (so if this is 5th field it should be $custom5 ).
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
Post Reply