Hi,

this has nothing to do with javascript. Your problem is how to get the string out of UITextField.

'sender' is UITextField, which does not have the method -stringValue like NSTextField. Look at the documentation of UITextField. You should use property 'text' instead.

izidor

P.S. You should ask the questions on mailing lists, so that others can benefit from answers.


On 5.12.2009, at 14:59, Philip Juel Borges wrote:

Hi.

You previously helped me out with calling a javascript function so that I could enter a number in an NSTextField and then go to the corresponding link in WebView. That workds great.

Now, how do I do that with an UIWebview and UITextField? I've searched and tried, but I can't get it to work.
My method is this:

-(IBAction)goToPage:(id)sender {
        /* call the javascript function named goToPage */
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"goToPage('%@');", [sender stringValue]]];
}



This doesn't work in the iPhone SDK environment. I get an error on sender stringValue. In Interface Builder I connect the UITextField outlet to the UITextField object and the goToPage action also to the UITextField. Like I would do for Mac app.

Do you know how to get this to work? I appreciate any help or direction in the right way.

--Philip

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to