• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting WebKit Form Values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting WebKit Form Values


  • Subject: Re: Getting WebKit Form Values
  • From: "Laurent Daudelin" <email@hidden>
  • Date: Tue, 03 Feb 2004 10:52:55 -0500

On 03/02/04 10:38, "Josh Ferguson" <email@hidden> wrote:

> I'm currently trying to (essentially) script a browser session using webkit.
> I'm not looking to be able to script any page - just my specific content. Is
> there a way to fetch values from an HTML form when a specific button is
> clicked? Is there a way to know which button on the form was clicked? Also,
> is there a way to associate a specific control in a WebView with its
> corresponding HTML id? If you have the answers to any of these questions, I'd
> greatly appreciate it. So far I'm somewhat disappointed in the limitations of
> WebKit. Cool technology demo, poor flexibility.

Not sure about detecting when a specific button is clicked. However, in the
frameLoadDelegate of your webview, implements
'webView:didFinishLoadForFrame:'. Then, use some Javascript embedded in an
NSString like the following to access any item on the form:

returnString = [myWebView stringByEvaluatingJavaScriptFromString:[NSString
stringWithFormat:@"document.forms[0].os0.value=\"%@\"", aValue]];

os0 here is the name of a textfield in the form. When the page is displayed,
the textfield contains 'aValue'. That works pretty well...

HTH!

-Laurent.
--
========================================================================
Laurent Daudelin Developer, Multifamily, ESO, Fannie Mae
mailto:email@hidden Washington, DC, USA
************************ Usual disclaimers apply ***********************
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Getting WebKit Form Values
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: DO and peer to peer communication
  • Next by Date: CFHTTPMessage authenticacion
  • Previous by thread: Getting WebKit Form Values
  • Next by thread: Re: Getting WebKit Form Values
  • Index(es):
    • Date
    • Thread