How do I check which field has the focus on / is active?

Jan Schenkel janschenkel at yahoo.com
Fri Oct 30 09:17:09 EDT 2009


--- On Fri, 10/30/09, William de Smet <williamdesmet at gmail.com> wrote:
> 
> Hi there all,
> 
> How do I check which has the focus on / is the active one?
> When I use: 'answer the selectedField' it shows me the
> correct field
> but when I put the next code into a button it doesn't work
> anymore:
> --
> on mouseUp
> put the name of the selectedField into tData
> 
> if tData = "number1"
> then send mouseup to btn "check"
> 
>  if tData = "number3"
> then send mouseup to btn "sum1"
> 
>  if tData = "number6"
> then send mouseup to btn "sum2"
> 
>  if tData = "number9"
> then send mouseup to btn "sum3"
> 
> if tData = "number12"
> then send mouseup to btn "sum4"
> 
> if tData = "number15"
> then send mouseup to btn "sum5"
> end mouseUp
> 
> --
> 
> Thanks!
> 
> Greetings, William
> 

If this is not on Mac, then your button is probably stealing the focus from the field when you click it. Try setting the 'traversalOn' of the button to false.

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)



      



More information about the use-livecode mailing list