Page 1 of 1
checkbox and fields
Posted: Sat Nov 30, 2013 6:38 pm
by vedus
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
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
Re: checkbox and fields
Posted: Mon Dec 02, 2013 1:48 am
by Mark
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
Re: checkbox and fields
Posted: Sun Dec 08, 2013 2:59 pm
by vedus
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
Re: checkbox and fields
Posted: Sun Dec 08, 2013 6:16 pm
by vedus
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