Page 1 of 1

previous marking a checkbox

Posted: September 1st, 2021, 10:48 am
by AriSilva
Is there a way to mark some specific entries in a checkbox field.
There is the ischeck function, which is very good, to get the responses that are marked, but what I need is, after creating dinamically the checkbox field, to mark certain responses that the user answered before.
Something like check(x, field);
Best
Ari

Re: previous marking a checkbox

Posted: September 1st, 2021, 11:26 am
by sherrell
Hi Ari,

I'm assuming you want to do something like the following? If so, you'd have to write your own function to do that, that's not something we currently offer in CSPro.
PROC ALPHA2
onfocus
  if ischecked
("A",alpha1) and !ischecked("A", $) then
   
$ = "A" + $;
 
endif;
Of course, this only works on a single character. If you wanted to check all values of alpha1, you'd have to make this recursive.

Sherrell

Re: previous marking a checkbox

Posted: September 2nd, 2021, 12:59 pm
by AriSilva
Thank you Sherrell,
I´m doing something like that with maketext instead of concat (your solution is much neater).
As a Christmas gift, could I suggest developing it as a built in function?
Best
Ari

Re: previous marking a checkbox

Posted: September 2nd, 2021, 4:19 pm
by sherrell
xmas pressies: lol

I'll let the guys know (tho I'm sure Greg at least has read this)

Note I modified the example above. I suppose I should use ischecked() over pos() (old habits die hard).

Sherrell