[rt-users] Mandatory Custom Field

Stephen Turner sturner at MIT.EDU
Mon Mar 10 14:06:44 EDT 2008


At Monday 3/10/2008 12:31 PM, Kenneth Crocker wrote:
>To all,
>
>
>         We have a Custom Field called "Need-By Date". It is applied 
> to only a
>few Queues. In order to ensure the format entered is consistent, I put
>the following "(?#Date)^\d{2}/\d{2}/\d{4}$" into the Validation field.
>The result is RT demands an entry as though it is a Mandatory Field. I
>only wanted the format to be mandatory so that IF it was entered, it
>would require the desired format. Any ideas on how to accomplish this?
>Thanks ahead of time.
>
>Kenn
>LBNL

Kenn,

Here's what we have for an optional date field (MM/DD/YY format):

'(?#Date-Optional 
MM/DD/YY)^(((0)?[1-9]|1[0-2])\/((0)?[1-9]|[12][0-9]|3[01])\/([12][0-9])?[0-9][0-9])?$',

It's the final '?' that makes this optional - without it, the field 
is mandatory.

Steve


Stephen Turner
Senior Programmer/Analyst - SAIS
MIT Information Services and Technology (IS&T)





More information about the rt-users mailing list