bygcrazyhart
New Member
I have a UIwebview where i load a website.. If i load this website i want to fill in the username and password. At the moment I test if I can fill in the username. The html of the page is as follows:\[code\] <p> <label for="username">[email protected]</label> <span><img src="http://stackoverflow.com/questions/12781363/images/icons/username.png" /></span> <input type="text" name="username" id="username" /> </p>\[/code\]The objective C code in xcode is as follows:\[code\]- (void)viewDidLoad{ NSString *urlString = @"http://THEwebsite...."; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webDisplayiPad loadRequest:request]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.}- (void)webViewDidFinishLoadUIWebView *)webView;{ [webView stringByEvaluatingJavaScriptFromString"var field = document.getElementById('username');" "field.value='http://stackoverflow.com/questions/12781363/User1';"]; }\[/code\]Problem is it doesn't work, anyone knows what I am doing wrong??? Thanks