Expand my Community achievements bar.

SOLVED

Pattern Validation...????

Avatar

Level 1

Hello

Is it possible to write a custom pattern validation to suit a phone number etc......

If any one could help with this it would be great or tell me where to go looking..

Cheers

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The sample is attached and should be accessible, above. If you cannot access it, send me an email at stwalker.adobe@gmail.com.

View solution in original post

11 Replies

Avatar

Level 1

Steve

The first to link don't work it say they are broken.

Cheers

Avatar

Level 1

Steve

Thanks for your help so far....

I'm still not 100% sure.. I'm I able to create a custom patten and save it if so how.... Can I change a default pattern and it's name and save it if so how...

Thanks
Jake

Avatar

Former Community Member

Jake,

You can use the predefined patterns as a template and create your own, but there is no officially supported way to save the pattern.

Steve

Avatar

Level 1

Steve

What is the best way to create a custom pattern... is it best to do it over a existing one or what... i can find any docs that tell you how to write them... can only find some examples...

Cheers

Avatar

Former Community Member

Patterns are admittedly confusing. I tend to use JavaScript to do formatting and validation because script objects can be saved and re-used.

Take a look at the predefined telephone pattern...

text{'('999')' 999-9999}

You are free to use the pattern syntax rules and create your own. For example,

text{'+1 ('999') '999-9999

The comma (,), dash (-), colon (:), slash (/), period (.), and space ( ) are treated as literal values and can be included anywhere in a pattern. To include a phrase in a pattern, delimit the text string with single quotation marks (').

I recommend that you go to the base LiveDocs URL for Designer, go the Index, click 'P', and scroll to 'patterns'. There is a lot of doc.

Steve

Avatar

Level 1

Thanks for your help.....

Dio you think it would be better to write this script in Javascript. If so how is the best way to do it......

Thanks

Avatar

Former Community Member

Jake,

I can't say there is a best way. The method you choose could be based upon personal preference, departmental guidelines, or organizational policy.

LiveCycle Designer ES enables less technical people to apply patterns to data capture and submission. The attached sample demonstrates the other end of the spectrum - the use of JavaScript, a script object, and regular expressions. If you are not fluent in JavaScript or regular expressions, the sample 'may do more harm than good'. The sample was created to validate a telephone number in Ireland.

Do a search on this forum and you will find numerous postings on this topic.

Steve

Avatar

Level 1

Steve

That is what i'm looking for..... Is it possible to get a copy of the Livecycle file Please...

Cheers

Avatar

Correct answer by
Former Community Member

The sample is attached and should be accessible, above. If you cannot access it, send me an email at stwalker.adobe@gmail.com.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----