Hello all,
I have a site I need to display in an IOS browser control that requires a username and password login via a form. I'd like to store the login credentials locally in a "setup" section of my iPad app, then log them in automatically. I thought I'd be doing it using a post command (the login is a form after all) but can't quite figure out how that links to the browser controll
Any thoughts on how to do this?
Another option I thought might be viable is using the execute command to fill in the username and password via JavaScript then submit the form?
Look forward to any help!
Cheers
Dale
Submit a login form using IOS browser control
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 83
- Joined: Mon Oct 31, 2011 5:28 am
-
- Posts: 83
- Joined: Mon Oct 31, 2011 5:28 am
Re: Submit a login form using IOS browser control
I managed to get it working using the load complete message to then run an execute command to fill in the fields then click the submit button. Would still rather do via post if possible. Will also try a local html file with the corresponding fields to try make it a little quicker, not sure yet if that will work with the remote server but will report back.
on browserFinishedLoading pURL
if gLoggedin is false then
put "document.getElementById('username').value='myusername';document.getElementById('password').value='thepassword';document.getElementById('login').click();" into pScript
iphoneControlDo gBrowserA["BrowserFIT"], "execute", pScript
put true into gLoggedIn
end if
end
on browserFinishedLoading pURL
if gLoggedin is false then
put "document.getElementById('username').value='myusername';document.getElementById('password').value='thepassword';document.getElementById('login').click();" into pScript
iphoneControlDo gBrowserA["BrowserFIT"], "execute", pScript
put true into gLoggedIn
end if
end