Page 1 of 1

Problem with option "Automatically advance on selection" for Checkbox field

Posted: February 9th, 2018, 12:04 pm
by thierryt
Hi all,
There is a new option on Cspro 7.0.2 for mobile named "Automatically advance on selection". It is very interesting for radio button fields. My problem is that, when i have a Chekbox field, when i select one value, the program automatically advance to the next field.
How can i do to fix it ?
Thanks

Re: Problem with option "Automatically advance on selection" for Checkbox field

Posted: February 9th, 2018, 2:15 pm
by josh
Sorry about this. It is a known issue. We are working on a fix for the next release.

Re: Problem with option "Automatically advance on selection" for Checkbox field

Posted: February 9th, 2018, 4:41 pm
by josh
You can test out the fix if you use the beta version of CSPro 7.1 (http://www.csprousers.org/beta/)

Posted: February 13th, 2018, 4:59 am
by segxy4manu
Use this syntax to run the two(2) questions that checkbox and the radio button
eg.
lets say the first question (multiple response)is:- Q1A
use the syntax bellow in it depending on how many value label you are using here i have A-K that is 1-11;

PROC Q1A

if alphachk( $, "ABCDEFGHIJK" ) then
errmsg("Codes entered are not acceptable");
reenter;
else
$ = alphavar;
endif;


Now for the next question that will filter out the options selected in the Q1A checkbox to the next that will be radio button. using Q1B

PROC Q1B

preproc
string alphabet = "ABCDEFGHIJK";

// If only one reason is taken automatically set that as the
// main reason.
if length(strip(Q1A)) = 1 then
// If length of reasons is one then it is a single letter.
// To convert the single letter indicating the reason to the numeric
// code we find the position of the letter in the alphabet string so
// if the letter is A the code will be 1 (Place of immunization too far),
// if the letter is B the code will be 2 (Time of immunization inconvenient) etc...
Q1B = pos(strip(Q1A), alphabet);
noinput;
endif;





onfocus

// Build value set for main reason from checked
// reasons in reasons taken


numeric nextValueSetEntry = 1;

// loop through the reasons
numeric i;
do i = 1 while i <= 11
string letter = alphabet[i:1];
if pos(letter, Q1A) > 0 then
// This reason was checked, add to value set
codes(nextValueSetEntry) = i; // code is just current index
// get label from value set of this item (numeric codes), use the dictionary value
// set main_reason_VS1 and just main_reason which would give current value
// set that gets modified by this routine.
labels(nextValueSetEntry) = getlabel(Q1B_VS1, i);
nextValueSetEntry = nextValueSetEntry + 1;
endif;
enddo;
codes(nextValueSetEntry) = notappl;
setvalueset(Q1B, codes, labels);


NOTE:-please you can change all the ..........._VS1 to the actual value set name you are using and those that has "A" ... mean "1"

thanks and i hope this work well for you cause its great using it in my program