restricting number for fields

Discussions about CSEntry
Post Reply
Titus
Posts: 13
Joined: November 10th, 2016, 7:27 am

restricting number for fields

Post by Titus »

dear forum,
1.I need to restrict a field to accept only 4 numbers during entry
2. I need to restrict field not to accept zero during entry.

kindly someone help me iam in trouble.

thank you
titus
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: restricting number for fields

Post by khurshid.arshad »

Dear Titus

1.I need to restrict a field to accept only 4 numbers during entry

Code: Select all

numeric findlength=length(strip(maketext("%d",variablename)));
if  findlength<4 then

errmsg ("Answer is not correct.");
reenter;
else
endif;
2. I need to restrict field not to accept zero during entry.

There are two options:

Option 1:

Code: Select all


If variablename= 0 then

errmsg ("You can not enter [...Zero...]", );
reenter;
else
endif;
Option 2

You can set range other than {0} in the value set labels.

a.
Titus
Posts: 13
Joined: November 10th, 2016, 7:27 am

Re: restricting number for fields

Post by Titus »

thanks very much khurshid.
it worked well
Titus
Posts: 13
Joined: November 10th, 2016, 7:27 am

Re: restricting number for fields

Post by Titus »

thanks khurshid, hope am not bothering you a lot , am new to Cspro, am under crisis please, now have tried to put a command for multiple responses so that am able to select more than one responses in tablet. kindly help me please.
Post Reply