View Full Version : How to make the phone number required
Snow_death
01-24-2008, 08:11 PM
I want users to put in a phone number and also it has to be 10 digits when opening a ticket. How do I do this? thank you!:o
HarvMan
04-08-2008, 02:37 AM
Hi, I too would like to make the phone number a required entry.
class.ticket.php references this field as follows:
$fields['phone'] = array('type'=>'phone', 'required'=>0, 'error'=>'Phone # required');
It seems to indicate that required fields contain 'required'=>1
Is that true? What other changes are necessary to implement?
Thanks!
Corey
04-08-2008, 03:06 AM
That's all you would need to do. You could also edit: /upload/include/client/open.inc.php
and add the asterisk ( * ) so users know you have to have that.
For number length you would edit:
File: /upload/include/class.validator.php
Line: 133
Find:
return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>13)))?false:true;
And change to: (As an example of 10)
return (!is_numeric($stripped) || ((strlen($stripped)<10) || (strlen($stripped)>13)))?false:true;
HarvMan
04-08-2008, 01:31 PM
That worked ...
In File: /upload/include/class.validator.php I restricted the length to exactly 10
i.e. <10 and >10
Thanks!