How to handle alert events in UIWebView

Discussion in 'iOS Programming' started by anuhoho, Jun 28, 2011.

  1. anuhoho macrumors newbie

    May 22, 2011

    I have a url which shows a username,password fields and a submit button. On clicking the submit button it pops up a alert view in my device stating some message. I need to capture that message and use it in my application. Now that are java alerts that are being displayed.

    So i need to find out a way so that as soon as the user clicks submit, I can disable the UIWebView and can take out the message from the pop up alert so that i can use it.
  2. jiminaus macrumors 65816


    Dec 16, 2010
    Maybe it's not possible under iOS to do this?

    Under Mac OS X, you'd attached a WebUIDelegate to the WebView. But iOS's UIWebView doesn't have this.
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    I think that the only way would be via javascript. But I have no idea how to do this.

    I know there are articles on the web with info on how to use javascript to get notifications from UIWebview. Look there.

Share This Page