Post Reply 
INPUT: can not get checkboxes to work
11-06-2020, 07:17 PM (This post was last modified: 11-06-2020 07:18 PM by emax.)
Post: #1
INPUT: can not get checkboxes to work
I have tried a form on the Prime. It works except for the two checkboxes at the very end. I want them to be "either/or" checkboxes, i.e.: only one shall be selectable.

If I understod the docs right, such checkboxes shall be enumerated - which I tried. But no success, I can check them both.

I tried two different versions:
  1. The two checkboxes were enumerated '1' and 2'.
  2. The boxes where equally numbered as in the version below, '1' and '1' (i.e.: not zero).

Neither worked.

Where is my mistake?

Code:

EXPORT formt()
BEGIN
  local wdayList := { " Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
  local wday := 1;
  local pers := 2;
  local leader := "George";
  local hours := 4;
  local cater := 1;
  local Tea := 0;
  local Coffee := 1;

  input( { {wday,wdayList, {40,60,0}},
           {pers,[1], {40,20,1}},
           {leader,[2], {40,60,2}},
           {hours,[0], {40,60,3}},
           {cater,0, {40,10,4}},
           {Tea,1, {40,10,5}},
           {Coffee,1, {40,10,6}} },
         { "Conference Booking" },
         { "Day", "Persons", "Team leader", "Hours", "Catering", "Tea", "Coffee" },
         { "Enter day of the week", 
           "Enter number of persons", 
           "Enter team leader name", 
           "Enter duration in hours", 
           "Shall catering be booked?", 
           "Do you want tea?", 
           "Do you want coffee?" },
         { 1,2,"George",4,1,0,1 },
         {}
)
END;
Find all posts by this user
Quote this message in a reply
11-06-2020, 07:27 PM
Post: #2
RE: INPUT: can not get checkboxes to work
I have now tried with an enumeration of '2' for both and then with '3' for both as well. Both values seem to work. If I use '1', it doesn't.

I don't understand the logic behind this.
Find all posts by this user
Quote this message in a reply
11-06-2020, 07:56 PM
Post: #3
RE: INPUT: can not get checkboxes to work
In the manual, p. 653:

"{var_name, real, [{pos}]} to create a check box control. If real is >1, this check box gets pooled with the next n -1 check boxes in a radio group (that is, only one of the n check boxes can be checked at any time)"

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-06-2020, 08:12 PM (This post was last modified: 11-06-2020 08:13 PM by emax.)
Post: #4
RE: INPUT: can not get checkboxes to work
Ahh, had missed this one. Seems logic now.

Thank you so much!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)