0
1

Hi openforis Team, I am trying to use pattern in collect earth form. I tried to research input pattern in xml but I could not understand clearly because I could not get examples what I wanted. I am trying a pattern something like this e.g. (MAK/BH/99/99). My user will input in that pattern. Will you please give me example what pattern should I define ? thank you in advance.

asked 04 Aug '16, 03:59

Rajkumar's gravatar image

Rajkumar
104626
accept rate: 0%


Hi Rajkumar,
The pattern you can define must be a regular expression. You can find a lot of documentation and tutorials in internet about that and even live regular expression tester (see for example RegExr). In Collect Survey Designer you can define a Pattern Check for a Text attribute so that the entered values will have to match the specified regular expression. In your case the expression can be this: [A-Z]{3}\/[A-Z]{2}\/[0-9]{2}\/[0-9]{2}
That means: accept only 3 uppercase letters followed by a forward slash "/" (you have to escape it using a backward slash before it) then accept other 2 uppercase letters followed by "/" then 2 numbers and a forward slash and other 2 numbers.
Also in the Message box of the Pattern Check please specify a meaningful error message for the users. I hope this will help you.
Thanks.
Open Foris Team

permanent link

answered 04 Aug '16, 10:39

OF%20Collect's gravatar image

OF Collect ♦♦
2.6k8
accept rate: 21%

Yes this worked for me.thank you very very much ricci.

(04 Aug '16, 17:04) Rajkumar Rajkumar's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×350

question asked: 04 Aug '16, 03:59

question was seen: 1,368 times

last updated: 04 Aug '16, 17:04