I am trying to use a combo box along with 3 option buttons to say something like this:
on mouseUp
if combobox "ComboBox1" is "2 Bottle" and
group "fillingmethod1" is "Bulk Fill Method" then put fld "fillingmethod2" of cd "fillingmethodcd2" of stack "data" into "fillingmethodvalue"
end if
But cannot get this to work. Can anyone tell me what I am doing wrong other than no experience?
Reference fields on other cards
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
A combobox is a button, and to get its current content, you have to use the 'label' property ; and to get the hilited radio button in your radio button group, you have to use one of the 'hilitedButton' / 'hilitedButtonID' / 'hilitedButtonName' properties.
Also, what are you trying to put the text of field "fillingmethoçd2" into? If it is a local variable, then lose the quotes ; if it is the name of a field then don't forget the keyword 'field' or Revolution won't know where to put it.
Also, what are you trying to put the text of field "fillingmethoçd2" into? If it is a local variable, then lose the quotes ; if it is the name of a field then don't forget the keyword 'field' or Revolution won't know where to put it.
Code: Select all
on mouseUp
if the label of button "ComboBox1" is "2 Bottle" and \
the hilitedButtonName of group "fillingmethod1" is "Bulk Fill Method" then
put fld "fillingmethod2" of cd "fillingmethodcd2" of stack "data" into field "fillingmethodvalue"
end if
end mouseUp
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Thanks for the response but I must be doing something wrong.
Here's what I have. I have 1 Combo Box on the main stack called "ComboBox1", I also have a group of 3 Radio buttons called "fillingmethod1", I also have a Text entry field on a second card called "fillingmethod2", and lastly I have another Text entry field on my main stack called "fillingmethodvalue"
I have been trying for 2 days now to get the text from the second card field "fillingmethod2" (which I would pre-enter a value into) to input into the main stack field called "fillingmethodvalue" if "Combobox1" = "2 Bottle" and the group of radio buttons called "fillingmethod1" = "Bulk Fill Method".
Here's what I have. I have 1 Combo Box on the main stack called "ComboBox1", I also have a group of 3 Radio buttons called "fillingmethod1", I also have a Text entry field on a second card called "fillingmethod2", and lastly I have another Text entry field on my main stack called "fillingmethodvalue"
I have been trying for 2 days now to get the text from the second card field "fillingmethod2" (which I would pre-enter a value into) to input into the main stack field called "fillingmethodvalue" if "Combobox1" = "2 Bottle" and the group of radio buttons called "fillingmethod1" = "Bulk Fill Method".
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
The script that I gave you earlier should do the trick. You can always do some light 'debugging' to figure out why it's not fetching the data:
This way, when you click the button it should tell you the respective values.
If you really can't find the solution, send me your email address via private message, and I'll email you my test stack to take apart.
HTH,
Jan Schenkel.
Code: Select all
on mouseUp
answer "Combobox1:" && the label of button "ComboBox1" & return & \
"FillingMethod1:" && the hilitedButtonName of group "fillingmethod1"
if the label of button "ComboBox1" is "2 Bottle" and \
the hilitedButtonName of group "fillingmethod1" is "Bulk Fill Method" then
put fld "fillingmethod2" of cd "fillingmethodcd2" of stack "data" into field "fillingmethodvalue"
end if
end mouseUp
If you really can't find the solution, send me your email address via private message, and I'll email you my test stack to take apart.
HTH,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com