Thanks.

Isn't IS_MATCH a validator?

I wanted a widget that had this built in;

How would I build a custom form widget that has this validator as its default.



On 6/28/11 3:32 PM, Niphlod wrote:
you need to play with regexes.....

assuming "parenthesis-3 digits-parenthesis-space-3 digits-hypen-4
digits" sequence

requires = IS_MATCH('\([\d]{3}\) [\d]{3}-[\d]{4}',
          error_message='please enter phone number in format (800)
555-1212')

should do it.

On Jun 23, 9:50 pm, "David J."<[email protected]>  wrote:
I need help trying to create a custom widget;

I want to create a phone-number widget

I want it to only accept text in (800) 555-1212

I am not sure how to do this.

Any ideas would be greatly appreciated.

Reply via email to