problems with WebView and TextField

Hello is my first post but for a while 'I work with the crown, having said that, I have a porblema with “textfield” and “WebView” I and a friend wanted to develop an app to run a search on twitter, It is given that each company has its url research, which for example is twitter

https://twitter.com/search?src=typd&q=%23KEY\_WORD

I inserted in place of a variable keyword

Url = "https://mobile.twitter.com/search?src=typd&q=%23" .. TextField.text -- Is part of a function -- native.newWebView (display.contentCenterX, display.contentCenterY + 800, 1250, 2800, URL)

and so everything is right only when I go to enter text in the text box and hit enter, update the information but the URL remains the same, as if the variable is not there, I did a test with console

print (TextField.text, URL)

and even doing so before printing the text right, then the variable but modified, and after the url lets incomplete … TextField.text as if it were not.

where am I wrong? I enclose below the complete code

local textField = native.newTextField (display.contentCenterX, display.contentCenterY - 800, 900, 100) TextField.text = "hash" Url = "https://mobile.twitter.com/search?src=typd&q=%23" .. TextField.text local GoBtn = display.newText ("GO", 0, 0, "Arial", 70) GoBtn.x = display.contentCenterX GoBtn.y = 300 GoBtn function: tap (s)     native.newWebView (display.contentCenterX, display.contentCenterY + 800, 1250, 2800, "https://mobile.twitter.com/search?src=typd&q=%23hash")     print (URL) end textListener local function (event)     if (event.phase == "submitted") then         var = TextField.text         print (TextField.text, URL)     end end textField: addEventListener ("userinput" textListener) GoBtn: addEventListener ("tap", GoBtn) Thank you in advance

your function to get values from the textbox is incomplete.

you need something like this:

local function textListener( event ) if ( event.phase == "began" ) then elseif ( event.phase == "editing" ) then password=event.text elseif ( event.phase == "ended" or event.phase=="submitted" ) then password=event.target.text if event.phase =="submitted" then native.setKeyboardFocus(nil) end end end

your function to get values from the textbox is incomplete.

you need something like this:

local function textListener( event ) if ( event.phase == "began" ) then elseif ( event.phase == "editing" ) then password=event.text elseif ( event.phase == "ended" or event.phase=="submitted" ) then password=event.target.text if event.phase =="submitted" then native.setKeyboardFocus(nil) end end end