iOS Question Send Enter to a textbox in a webview. (Solved)

Swissmade

Well-Known Member
Licensed User
Longtime User
Search the forum but have no solution yet.
I'm really a nope with Iphone but still learning.

I have a webpage where I fill a textbox to login with javascript. This part is working just like Android.
SentJavaScripttoInputfield:
Private Sub SentJavaScriptSeed
    Dim sf As Object = WV1.EvaluateJavaScript("document.getElementsByClassName('loginInputField')[0].value = '" & (The Value Here) & "'")
    Wait For (sf) WV1_JSComplete (Success As Boolean, Result As String)
    modFunctions.showlog(Result.Length, False)
    modFunctions.showlog("text " & Result, False)
    Sleep(100)
End Sub

But now I need to send the key Enter to validate the value.

For Android I have used the library SendInput for this but for B4I I can not find this.

Thanks for helping me out here.
 
Last edited:

Swissmade

Well-Known Member
Licensed User
Longtime User
Tip: learn how to use smart strings.

You can get the button element and call click().
Yes I know that a click must do that. But not on this page with javascript.
Or there you mean smart strings?
Never used them before
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Tip: learn how to use smart strings.

You can get the button element and call click().

There is no button element. The click has to be in the textbox to validate the input.
Maybe I have to send the Project what is only testing yet so not fancy at all to understand what I mean.
After the text is put in this textbox enter has to be given to validate. This enter has to be with code and no button. \r\n for javascript is not working somehow.
Maybe I need to open the keyboard first and then send this command.
 
Last edited:
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Solved with add a onClick event to the react page and call the click() event with javascript.
 
Upvote 0
Top