1

In my app I'm using third party web survey tool. I load the survey into a UIWebView and the user has to fill this one out.

My question is, can I somehow pass some string parameters to that survey form to pre-fill some of the textfields?

Any kind of help is highly appreciated.

Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80
  • 1
    You can send parameters with the url by GET method : http://stackoverflow.com/questions/1226363/send-parameters-to-a-local-file-in-a-uiwebview – Pipiks Jan 08 '16 at 19:24
  • You can execute javascript in your webview from your app. – CrimsonChris Jan 08 '16 at 20:00
  • can you please be more descriptive? – Eugene Gordin Jan 08 '16 at 20:01
  • @DavidCheung did you notice that the question is from the app to the web? the post you're referring to is from web to app. – Eugene Gordin Jan 09 '16 at 18:31
  • @EugeneGordin Please check out [WebViewJavascriptBridge](https://github.com/marcuswestin/WebViewJavascriptBridge) for sending messages between Obj-C and JavaScript in UIWebViews/WebViews. – chubao Jan 10 '16 at 00:59

1 Answers1

0

You either could use UIWebView's stringByEvaluatingJavaScriptFromString: to run your javascript which pre-fills the textfields.

or using the WebViewJavascriptBridge.

Please check out this SO question:

Communication between iOS's native app and webpage's javascript

Community
  • 1
  • 1
chubao
  • 5,871
  • 6
  • 39
  • 64