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!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742286543a4415425.html
评论列表(0条)