I’m trying to automatically fill and submit an HTML form on the iPhone and iPad, but then view the resulting page in a UIWebView.
Example: There’s a website to add money to a meal plan for my university, and it requires you to put in your student number first, press submit, put in your password, press submit, then it reveals your balance after that.
I am trying to make an app that lets you save your information in it, press GO and then in the background it will fill in the saved student number, hit submit, wait for the resulting page to be loaded, then input the password, press submit, then finally display the resulting page with the balance.
I’ve tried multiple times to submit forms, but can’t get them to display in a UIWebView after.
Does anyone have any ideas or solutions?
Appreciate all the help! Sorry if it’s a silly question.
You can do it with JavaScript. Use the
-stringByEvaluatingJavaScriptFromString:method of UIWebView to enter the text and click the button.