Setting the contents of a field

Mark Wieder mwieder at ahsoftware.net
Sat Jul 24 23:29:23 EDT 2010


Ted-

Saturday, July 24, 2010, 8:18:17 PM, you wrote:


> I am not getting a runtime error but the field on card id 1176 is not
> changing either but is placed on the field on card 1176. I do not have it on
> a mouseup handler either. Should it be? And should the code be placed on the
> radio button group instead?

(starting to get the picture now)

OK - here's what I think is happening... what you want to do is
trigger your code to execute when something happens. In this case it's
probably the act of clicking one of the radio buttons in the group. So
when the user clicks one of the buttons you want to catch the mouseUp
event and run your code. The mouseUp message will propagate down the
object hierarchy from the button to the group to the card to the stack
until it's caught by an appropriate handler.

To do this you place your code in a mouseUp handler somewhere in the
path - for your purpose this could be in the script of the card with
the radio buttons or in the group containing them (or in the stack
script, but that's getting a bit far afield).

So edit the script of the card and place the following handler in
there (and compile it <g>)

on mouseUp
  if the hilite of btn "Radio3" of group id 1223 is true then
     put "Yes" into Field "fldCompreq" of card id 1176
   else
     put "No" into Field "fldCompreq" of card id 1176
  end if
end mouseUp

That should get you going. Note that this will catch mouseUp events
anywhere in the card, so if you've got this working you may want to
move this script into the group instead to limit its scope.

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list