开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜