Page 1 of 1

Restricting Customized Field

Posted: Fri Aug 27, 2010 6:13 am
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.

Re: Restricting Customized Field

Posted: Fri Aug 27, 2010 3:16 pm
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 ).