TextFields save text

I am trying to save a text field with the following code

 -- TextField Listener  
 local function fieldHandler( getObj )  
 return function( event )  
 if ( "began" == event.phase ) then  
 --keyboard shows up  
 elseif ( "ended" == event.phase ) then  
 -- This event is called when the user stops editing a field:  
 print( tostring(event.text ))  
 elseif ( "submitted" == event.phase ) then  
 -- This event occurs when the user presses the "return" key  
 -- (if available) on the onscreen keyboard  
 -- Hide keyboard  
 print( tostring(event.text ))  
 native.setKeyboardFocus( nil )  
 end  
  
 end   
  
 end  
  

I have two things to say print (event.text) but it still wont work?

Can anybody help me?

Thanks

[import]uid: 24708 topic_id: 27657 reply_id: 327657[/import]

As per the api page:

print( "Text entered = " .. tostring( getObj().text ) ) -- display the text entered  

http://docs.coronalabs.com/api/library/native/newTextField.html

Hope that helps :slight_smile: [import]uid: 84637 topic_id: 27657 reply_id: 112336[/import]