Hello. Is there a way to add a constraint so that the first letter is
evaluated?
For example.
I have a barcode that has labels that start with P and labels that
start with S. I want to make sure for a particular variable they scan
the right barcode. I tried to edit the XML and add:
constraints are only evaluated on the swipe to the next screen. also,
your xml isn't correct. you have to do something like this...
note that the regex command has to go inside the constraint attribute.
yaw
···
On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> Hello. Is there a way to add a constraint so that the first letter is
> evaluated?
>
> For example.
> I have a barcode that has labels that start with P and labels that
> start with S. I want to make sure for a particular variable they scan
> the right barcode. I tried to edit the XML and add:
>
> regex="^P"/>
>
> But, it didn;t stop me from scanning a S barcode.
>
>
> Thanks!!!
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
I want to make sure the barcode starts with a P and then there is
either 6 numbers or a second letter and 5 numbers.
ex.
P123456
or
PZ12345
···
On Jun 16, 3:45 pm, Yaw Anokwa wrote:
> hi alex,
>
> constraints are only evaluated on the swipe to the next screen. also,
> your xml isn't correct. you have to do something like this...
>
> constraint="regex(.,
> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
> jr:constraintMsg="this isn't a valid email address"/>
>
> note that the regex command has to go inside the constraint attribute.
>
> yaw
>
>
>
>
>
>
>
> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> > Hello. Is there a way to add a constraint so that the first letter is
> > evaluated?
>
> > For example.
> > I have a barcode that has labels that start with P and labels that
> > start with S. I want to make sure for a particular variable they scan
> > the right barcode. I tried to edit the XML and add:
>
> > > regex="^P"/>
>
> > But, it didn;t stop me from scanning a S barcode.
>
> > Thanks!!!
>
> > --
> > Post: opendatakit@googlegroups.com
> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> > Options:http://groups.google.com/group/opendatakit?hl=en
···
On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
> Thanks, Yaw.
>
> So, is this syntax correct:
>
> constraint="regex(.,
> '^P\.\d\d\d\d\d\"
> jr:constraintMsg="Person ID must begin with a P"/>
>
> I want to make sure the barcode starts with a P and then there is
> either 6 numbers or a second letter and 5 numbers.
>
> ex.
> P123456
> or
> PZ12345
>
>
>
> On Jun 16, 3:45 pm, Yaw Anokwa wrote:
>> hi alex,
>>
>> constraints are only evaluated on the swipe to the next screen. also,
>> your xml isn't correct. you have to do something like this...
>>
>> > constraint="regex(.,
>> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
>> jr:constraintMsg="this isn't a valid email address"/>
>>
>> note that the regex command has to go inside the constraint attribute.
>>
>> yaw
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
>> > Hello. Is there a way to add a constraint so that the first letter is
>> > evaluated?
>>
>> > For example.
>> > I have a barcode that has labels that start with P and labels that
>> > start with S. I want to make sure for a particular variable they scan
>> > the right barcode. I tried to edit the XML and add:
>>
>> > > > regex="^P"/>
>>
>> > But, it didn;t stop me from scanning a S barcode.
>>
>> > Thanks!!!
>>
>> > --
>> > Post: opendatakit@googlegroups.com
>> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
Sorry, I tried the following and it crashes the app after I try to
swipe next:
···
On Jun 22, 2:08 pm, Yaw Anokwa wrote:
> that regex won't work. try
>
> regex(,(P[0-9]{6})|(PZ[0-9]{5}))
>
>
>
>
>
>
>
> On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
> > Thanks, Yaw.
>
> > So, is this syntax correct:
>
> > > constraint="regex(.,
> > '^P\.\d\d\d\d\d\"
> > jr:constraintMsg="Person ID must begin with a P"/>
>
> > I want to make sure the barcode starts with a P and then there is
> > either 6 numbers or a second letter and 5 numbers.
>
> > ex.
> > P123456
> > or
> > PZ12345
>
> > On Jun 16, 3:45 pm, Yaw Anokwa wrote:
> >> hi alex,
>
> >> constraints are only evaluated on the swipe to the next screen. also,
> >> your xml isn't correct. you have to do something like this...
>
> >> >> constraint="regex(.,
> >> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
> >> jr:constraintMsg="this isn't a valid email address"/>
>
> >> note that the regex command has to go inside the constraint attribute.
>
> >> yaw
>
> >> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> >> > Hello. Is there a way to add a constraint so that the first letter is
> >> > evaluated?
>
> >> > For example.
> >> > I have a barcode that has labels that start with P and labels that
> >> > start with S. I want to make sure for a particular variable they scan
> >> > the right barcode. I tried to edit the XML and add:
>
> >> > >> > regex="^P"/>
>
> >> > But, it didn;t stop me from scanning a S barcode.
>
> >> > Thanks!!!
>
> >> > --
> >> > Post: opendatakit@googlegroups.com
> >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> >> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> > --
> > Post: opendatakit@googlegroups.com
> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> > Options:http://groups.google.com/group/opendatakit?hl=en
···
On Wed, Jun 22, 2011 at 15:20, Alex Pavluck wrote:
> Sorry, I tried the following and it crashes the app after I try to
> swipe next:
>
> constraint="regex(',(P[0-9]{6})|(PZ[0-9]{5})')"/>
>
>
>
> On Jun 22, 2:08 pm, Yaw Anokwa wrote:
>> that regex won't work. try
>>
>> regex(,(P[0-9]{6})|(PZ[0-9]{5}))
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
>> > Thanks, Yaw.
>>
>> > So, is this syntax correct:
>>
>> > > > constraint="regex(.,
>> > '^P\.\d\d\d\d\d\"
>> > jr:constraintMsg="Person ID must begin with a P"/>
>>
>> > I want to make sure the barcode starts with a P and then there is
>> > either 6 numbers or a second letter and 5 numbers.
>>
>> > ex.
>> > P123456
>> > or
>> > PZ12345
>>
>> > On Jun 16, 3:45 pm, Yaw Anokwa wrote:
>> >> hi alex,
>>
>> >> constraints are only evaluated on the swipe to the next screen. also,
>> >> your xml isn't correct. you have to do something like this...
>>
>> >> > >> constraint="regex(.,
>> >> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
>> >> jr:constraintMsg="this isn't a valid email address"/>
>>
>> >> note that the regex command has to go inside the constraint attribute.
>>
>> >> yaw
>>
>> >> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
>> >> > Hello. Is there a way to add a constraint so that the first letter is
>> >> > evaluated?
>>
>> >> > For example.
>> >> > I have a barcode that has labels that start with P and labels that
>> >> > start with S. I want to make sure for a particular variable they scan
>> >> > the right barcode. I tried to edit the XML and add:
>>
>> >> > > >> > regex="^P"/>
>>
>> >> > But, it didn;t stop me from scanning a S barcode.
>>
>> >> > Thanks!!!
>>
>> >> > --
>> >> > Post: opendatakit@googlegroups.com
>> >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> >> > Options:http://groups.google.com/group/opendatakit?hl=en
>>
>> > --
>> > Post: opendatakit@googlegroups.com
>> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
Is the second letter always going to be a 'Z'? If not then perhaps it should
be constraint="regex(.,'(P[0-9]{6})|(P[A-Z]{1}[0-9]{5})')"/> or something
close to that.
···
On Wed, Jun 22, 2011 at 10:47 PM, Yaw Anokwa wrote:
Hello. Is there a way to add a constraint so that the first letter
is
evaluated?
For example.
I have a barcode that has labels that start with P and labels that
start with S. I want to make sure for a particular variable they
scan
the right barcode. I tried to edit the XML and add: