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 8678841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:49:27+00:00 2026-06-12T20:49:27+00:00

I have a UIWebView and I have a simple form like this: <form action=http://message/>Your

  • 0

I have a UIWebView and I have a simple form like this:

    <form action="http://message/">Your Email: <input id="email" /><br />
        <input type="submit" value="Submit" />
    </form>

and right now there is no JS validation, and the form just gets submitted somewhere and I am not sure how to get the field values. All I have in my controller is this:

- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{   
    if ([request.URL.scheme isEqualToString:@"message"]) 
    {
        // RIGHT NOW THIS DOESNT WORK...HOW DO I GET IT RIGHT? :)
        NSString *useremail = [theWebView stringByEvaluatingJavaScriptFromString:@"getEmail()"];
        NSLog(useremail);

    }  

    return YES;
}

I am not sure how exactly to get the controller to see what the field values and how to validate the field values in the js.

Please advise me how to best accomplish this.

I also tried creating a JavaScript function to simply hit the request url (that is all I really need) but that is not sending the request url:

    <script type="text/javascript">
    function test () 
    {
        // Het the params.
        var name = escape(document.getElementById("name").value);
        var email = escape(document.getElementById("email").value);
        var phone = escape(document.getElementById("phone").value);


        var url="http://www.myurl.com?platform=ios&name="+name+"&email="+email+"&phone="+phone;
        alert(url);




        var ajaxObj = createXMLHttp();
        //var url = 'myrequest.php';
        ajaxObj.open("GET", url, true);
        ajaxObj.onreadystatechange = function() 
        {
            ajaxObj.processRequest();
        }
            ajaxObj.send(null);

            ajaxObj.processRequest = function() 
            {
              if (this.readyState == 4) 
              {
                // got response
              }
            }


        alert("1");
        var req ;

        // Browser compatibility check                  
        if (window.XMLHttpRequest) {
            req = new XMLHttpRequest();
        } else if (window.ActiveXObject) {

            try {
                req = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {

                try {
                    req = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }

        }


        var req = new XMLHttpRequest();
        req.open("GET", url ,true);
        req.onreadystatechange = function () 
        {
            //document.getElementById('divTxt').innerHTML = "Contents : " + req.responseText;
        }

        req.send(null);  

       return false;
    }
        </script>

Thanks!

  • 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-12T20:49:28+00:00Added an answer on June 12, 2026 at 8:49 pm

    How about something like this:

    - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {   
        if ([request.URL.scheme isEqualToString:@"message"]) 
        {
            NSString *useremail = [theWebView stringByEvaluatingJavaScriptFromString:@"escape(document.getElementById(\"email\").value);"];
            NSLog(useremail);
    
        }  
    
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple app with a full screen UIWebView. This contains HTML generated
i have a UIWebView loaded with a simple rtf file. (containing one line THIS
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net . But I want to
I have a very simple UIWebView with content from my application bundle. I would
in my iPhone app, I have an UIWebView with some simple HTML links to
I have a simple UIViewController with just a UIWebView. The UIWebView should take all
I have a simple UIWebView nested in a ViewController it is presented modally off
Simple question. I have a UIWebView. It displays plain html text with a few
Simple concept, however it's not working. I have two buttons in my UIWebView ,
I have a UIViewController one UIWebView in it. I'd like the UIWebView to be

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.