View Full Version : Drop Down Box in a UIWebView

Apr 3, 2009, 07:56 AM
Hi all,

i am using a select tag in a UIWebView in my application but facing with some problems. (maybe they are not the problems but i m soo new for iphone programming)

1. when the select box is clicked a UIPickerView opens, is there any way to disable it?
2. when the select box is clicked it gets lost and when i click to its place again it comes up, is there any way to stop this? cause i always want it to be shown.

here is my code:

webView = [[UIWebView alloc] initWithFrame:cellRectangle];
NSString *content = [NSString stringWithString:@""];
content = [content stringByAppendingString:@"<select style='width:100%; height:100%'>"];
for(int i = 0; i<[seasons count]; i++){
Season *aSeason = [seasons objectAtIndex:i];
content = [content stringByAppendingString:@"<option"];
if(aSeason.n_isCurrent = 1) content = [content stringByAppendingString:@" selected=\"yes\""];
content = [content stringByAppendingString:@">"];
content = [content stringByAppendingString:aSeason.c_Season];
content = [content stringByAppendingString:@"</option>"];
content = [content stringByAppendingString:@"</select>"];

webView.backgroundColor = [UIColor clearColor];
webView.scalesPageToFit = NO;
[webView setOpaque:NO];
[webView loadHTMLString:content baseURL:nil];

thanx in advance.