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
.
精彩评论