Hi,
As i can't solve some issues with httputils2 i'm trying to do it with webview, but with webview i can't even login to the site.
when i use document.forms.loggain.submit() in the javascript the page just updates itself. Why is this happening?
When i remove "document.forms.loggain.submit();" from the code it fills the user textbox on page with username and password box with password and i can login just pushing the button on page.
edit: removed b.initialize
As i can't solve some issues with httputils2 i'm trying to do it with webview, but with webview i can't even login to the site.
when i use document.forms.loggain.submit() in the javascript the page just updates itself. Why is this happening?
When i remove "document.forms.loggain.submit();" from the code it fills the user textbox on page with username and password box with password and i can login just pushing the button on page.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim w1 As WebView
Dim on As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
w1.Initialize ("w1")
Activity.AddView (w1,0,0,100%x,100%y)
w1.LoadUrl ("http://www.usabil.nu/message/loggain.asp")
on = 0
End Sub
Sub w1_PageFinished (Url As String)
If on = 0 Then
on =1
Dim Javascript As String
Dim MyWebViewExtras As WebViewExtras ' you could make this a global variable if you use it elsewhere in your code
Javascript="document.forms.loggain.txtUsrName.value='User';document.forms.loggain.txtUsrPassword.value='Password';document.forms.loggain.submit();"
MyWebViewExtras.executeJavascript(w1, Javascript)
End If
End Sub
edit: removed b.initialize
Last edited: