admin管理员组文章数量:1332389
Quick question - if a textfield in a webform, does not automatically has the focus set by the form, ie you got to press the field before the keyboard pops up - am I correct to assume that field cannot be edited then?
In other words - I cannot set a text for a textField by injecting javascript into it, unless it gets a focus upon loading of the website right?
NOTE: I am not talking about set texts or placeholders here:-)
Cheers
Quick question - if a textfield in a webform, does not automatically has the focus set by the form, ie you got to press the field before the keyboard pops up - am I correct to assume that field cannot be edited then?
In other words - I cannot set a text for a textField by injecting javascript into it, unless it gets a focus upon loading of the website right?
NOTE: I am not talking about set texts or placeholders here:-)
Cheers
Share asked May 8, 2012 at 19:57 jwknzjwknz 6,82417 gold badges76 silver badges117 bronze badges1 Answer
Reset to default 10Yes you can! You can use Javascript to set the value:
[theWebView stringByEvaluatingJavaScriptFromString:@"document.getElementById('textFieldID').value = 'MyText'"]
Here's an article which shows you how to set and get the values of textfields with Javascript.
Hope this helped!
本文标签: javascriptiosInjecting text into a UIWebView textFieldStack Overflow
版权声明:本文标题:javascript - ios - Injecting text into a UIWebView textField - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742286542a2447032.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论