开发者

How to keep a form filled on a UIWebView on the iPhone?

开发者 https://www.devze.com 2023-01-02 08:54 出处:网络
I use a form in a UIWebView in my iPhone application that initially is blank. After the user enters his name for the first time, I would like to store that information and use it for future form submi

I use a form in a UIWebView in my iPhone application that initially is blank. After the user enters his name for the first time, I would like to store that information and use it for future form submissions, from the same app of course. Does this have to happen through javascript or from the iP开发者_JAVA百科hone API? I read about NSHTTPCookie and I'm not sure if this is what I want to use..

Thanks for any suggestion!


If you are storing the HTML source for the form locally, then the easiest thing to do will be to modify the HTML source to include the inital values of the input elements.

For example, you can store the HTML as an NSMutableString and modify it as needed. You can load it into the webview using the loadHTMLString method of UIWebView.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号