Force alphanumeric fields to be filled in

Discussions about CSEntry
Post Reply
Floris

Force alphanumeric fields to be filled in

Post by Floris »

Certain types of alphanumeric items can contain any answer (e.g., names, why-questions...), for which it is impossible to use a value set. However, this seems to imply that during data entry it cannot be enforced that the field is effectively filled in (it can be left blank by just pressing enter, either intentionally or unintentionally), although an entry might be required from a theoretical viewpoint. Is there any way of enforcing alphanumeric fields to be filled in, e.g., by requiring that at least one character is filled in?

Thanks!
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Force alphanumeric fields to be filled in

Post by josh »

You can add logic in the postproc to check if the response is empty. For example:

PROC myalphaitem

// Force item to be non-blank
if strip(myalphaitem) = "" then
errmsg("This field may not be blank");
reenter;
endif;
Floris

Re: Force alphanumeric fields to be filled in

Post by Floris »

Great, thanks!
Post Reply