Page 1 of 1

Submit a login form using IOS browser control

Posted: Fri Jul 12, 2013 6:49 am
by colourpixels
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

Re: Submit a login form using IOS browser control

Posted: Sat Jul 13, 2013 2:18 am
by colourpixels
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