Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:39:09+00:00 2026-06-05T15:39:09+00:00

I have a HTML form that has certain fields which i am opening inside

  • 0

I have a HTML form that has certain fields which i am opening inside a UIWebview. On click of a particular button i want to do a in app action.

The approach i’m using now is on click of the button i redirect the page to a dummy URL. I sniff the URL using delegate method “shouldStartLoadWithRequest” and stop the redirection. I then do my custom event (capture image and upload) and then continue. This seems to be an ugly hack. Anyway i can directly hook into the button click event rather than a page redirection?

UPDATE
There seems to be no way to setup a delegate method to fire when a JS function is called on button click. The only way to do this is to use the URL sniffing method mentioned above. This has been explained in detail by joern below, so I will accept his answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:39:11+00:00Added an answer on June 5, 2026 at 3:39 pm

    You can do the following:

    In your HTML

    <a class="yourButton" href="inapp://capture">Button Text</a>
    

    In your UIWebViewDelegate

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
       if ([request.URL.scheme isEqualToString:@"inapp"]) {
          if ([request.URL.host isEqualToString:@"capture"]) {
             // do capture action
          }  
          return NO;
       }  
       return YES;
    }
    

    I added “capture” to your button’s URL so that you could distinguish between several buttons that should trigger different actions (if you want to):

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webrequest that returns a html response which has form inside with
So I have a html page that has a form, and a table inside
I have a HTML form that accepts a comma separated list of tags, which
I have an html form that has the following structure: <input type=text name=title />
I have a html-form with checkboxes. It is required that has been checked by
i have form that has multiple input text boxes, Which has got some text
Hi all I have a form that has 4 fields I can get it
I have kind of a lazy form that has two textboxes. When I click
I have a following problem, I have HTML form that uploads a file with
I have a html form that posts to a new page on submit. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.