checkbox and fields

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

checkbox and fields

Post by vedus » Sat Nov 30, 2013 6:38 pm

i know the question is stupid,but my mind have is a bit confused.
i have make a database with 1 table and some fields.
the schema is something like this
Screen Shot 2013-11-30 at 7.29.42 PM.png
i have stack in the point of:
the blue lines in the right of photo must be with checkboxes so will be multi selection from my customer and i am stack on >,i need for every checkbox 1 field in my database or can i have the multi selection in 1 field for all checked boxes?
the blue lines is something like info for the customer to know what need to do before she go to appointment.
thank you

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: checkbox and fields

Post by Mark » Mon Dec 02, 2013 1:48 am

Hi,

It is very difficult to understand what you wrote. I don't know if my answer helps you.

Yes, you can check multiple checkboxes. If you want to have a list of these checkboxes, you could make a repeat loop:

Code: Select all

repeat with x = 1 to number of buttons of grp "Checkboxes"
  if the hilite of btn x of grp "Checkboxes" then
    put the short name of btn x of grp "Checkboxes" & cr after myList
  end if
end repeat
put myList into fld 1
For this script to work, you need to select all checkboxes and group them. The group's name needs to be "Checkboxes". You also need a field. Try this in an empty stack to see how it works.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

Re: checkbox and fields

Post by vedus » Sun Dec 08, 2013 2:59 pm

Mark wrote:Hi,

It is very difficult to understand what you wrote. I don't know if my answer helps you.

Yes, you can check multiple checkboxes. If you want to have a list of these checkboxes, you could make a repeat loop:

Code: Select all

repeat with x = 1 to number of buttons of grp "Checkboxes"
  if the hilite of btn x of grp "Checkboxes" then
    put the short name of btn x of grp "Checkboxes" & cr after myList
  end if
end repeat
put myList into fld 1
For this script to work, you need to select all checkboxes and group them. The group's name needs to be "Checkboxes". You also need a field. Try this in an empty stack to see how it works.

Kind regards,

Mark
Thank you mark , have try it and is working ;)
my last question is
when i try with unicode i get error missing the "of" or empty field
i think my code is ok but...
here is code

Code: Select all

on mouseUp
   repeat with x = 1 to number of buttons of grp "days"
  if the hilite of btn x of grp "days" then
    put the uniDecode (the unicodelabel of btn x of grp days,"UTF8") & cr after myList
  end if
end repeat
set the unicodetext of fld "field_days" to uniencode(myList,"UTF8")
put myList into fld "field_days"
end mouseUp

vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

Re: checkbox and fields

Post by vedus » Sun Dec 08, 2013 6:16 pm

ok i figure out ;)
so if anyone maybe find useful here is

Code: Select all

on mouseUp
   set the useUnicode to true
repeat with x = 1 to number of buttons of grp "days"
  if the hilite of btn x of grp "days" then
   put unidecode(the unicodelabel of btn x of grp "days","utf8") & cr after mylist
  end if
end repeat
set the unicodetext of fld "mydays" to uniencode(mylist,"utf8")
end mouseUp

Post Reply