Checkbox validation
Posted: March 15th, 2018, 10:08 am
Hi everyone ! am new to cspro ... just started working on cspro few days back.
I've this code for checkbox selected values validation , value list consists 01,02,03,04,05,06,..
this detects wrong keyed values ...
how to convert this procedure to global function ? so that i can pass checkbox variable name dynamically.
Regards.
---- here's the code -----------------------
PROC S1_1_WHAT_RIGHTS_WOMEN_HAVE // checkbox
postproc
numeric i ;
numeric start = 0;
do i = 1 while i <= length(strip(S1_1_WHAT_RIGHTS_WOMEN_HAVE))
start = ( i * 2 ) - 1;
if not invalueset(S1_1_WHAT_RIGHTS_WOMEN_HAVE[start:2]) then
errmsg("%s is not a valid option. Please review your selections.",S1_1_WHAT_RIGHTS_WOMEN_HAVE[start:2]);
endif;
enddo;
-----------------------------------------------
I've this code for checkbox selected values validation , value list consists 01,02,03,04,05,06,..
this detects wrong keyed values ...
how to convert this procedure to global function ? so that i can pass checkbox variable name dynamically.
Regards.
---- here's the code -----------------------
PROC S1_1_WHAT_RIGHTS_WOMEN_HAVE // checkbox
postproc
numeric i ;
numeric start = 0;
do i = 1 while i <= length(strip(S1_1_WHAT_RIGHTS_WOMEN_HAVE))
start = ( i * 2 ) - 1;
if not invalueset(S1_1_WHAT_RIGHTS_WOMEN_HAVE[start:2]) then
errmsg("%s is not a valid option. Please review your selections.",S1_1_WHAT_RIGHTS_WOMEN_HAVE[start:2]);
endif;
enddo;
-----------------------------------------------