Active textbox name

Is there a way to get the active textbox name?

Basically I want to pass this name to the keyboard handler, or have the keyboard handler routine detect this through the event.

I dont seem to be having much joy.
In the keyboard event handler I have tried the following

local function KeyboardHandlerMove( event )  
 if ( "began" == event.phase ) then  
 event.text="Kjkjkjkjkjk"  
 event.y=20  
 print(event.name)  
 elseif ( "ended" == event.phase ) then  
 event.text="Kjkjkjkjkjk"  
 event.y=20  
 print(event.name)  
 elseif ( "submitted" == event.phase ) then  
 event.text="Kjkjkjkjkjk"  
 event.y=20  
 print(event.name)  
 native.setKeyboardFocus( nil )  
 end  
 end  
txtPhone = native.newTextField( 0, 40, 120, 40, KeyboardHandlerMove )  

I have also tried

event.target.text  
event.target.id  

etc.

The only other way I could think of doing this was to have a local variable called “CurTextBox” and use this as a flag for current textbox. This would be set by assigning a listener to each textbox to set this flag and then passing CurTextBox into the keyboard handler.

I was hoping there was a tidier way to do this.
I would be forever grateful for some insight…well grateful for at least a few hours anyway :slight_smile:

[import]uid: 103163 topic_id: 19548 reply_id: 319548[/import]

check this page:

http://developer.anscamobile.com/reference/index/nativenewtextfield

The handler shown there can detect what text field is being used, I presume it will be the same here

[import]uid: 24641 topic_id: 19548 reply_id: 75547[/import]

Thanks for this. I will have another look tomorrow using the code from the example.

Not sure why I overlooked this in the first place?

[import]uid: 103163 topic_id: 19548 reply_id: 75549[/import]