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

  • SEARCH
  • Home
  • 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 8006885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:39:32+00:00 2026-06-04T17:39:32+00:00

Let’s say I have an HTML like this: <html> <form> <input type=button id=Signature8 pdfFieldName=Signature8

  • 0

Let’s say I have an HTML like this:

<html>
<form>
<input type="button"  id="Signature8"  pdfFieldName="Signature8"  onclick="document.location='pdz://signatureTapped?name=Signature8'" />
</form>
</html>

and I want to replace it programmatically with

<html>
<form>
<img src="Signature8.png">
<input type="button"  id="Signature8"  pdfFieldName="Signature8"  onclick="document.location='pdz://signatureTapped?name=Signature8'" />
</img>
</form>
</html>

in Objective-C with a UIWebView. What I did so far, is come up with this:

-(void) injectCode:(NSString*) code intoWebView:(UIWebView*) webView withEndCode:(NSString*) endCode {
  NSString* innerhtml = [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.forms[0].%@.outerHTML", self.identifier]];
  NSString* newCode = [NSString stringWithFormat:@"document.forms[0].%@.outerHTML=%@%@%@", self.identifier, code, innerhtml, endCode];
  [webView stringByEvaluatingJavaScriptFromString:newCode];
  NSLog(@"%@", [webView stringByEvaluatingJavaScriptFromString:@"document.body.outerHTML"]);
}

which should be called like this:

  [f injectCode:[NSString stringWithFormat:@"<img src=\"%@.png\" id=\"%@\">", f.identifier, f.identifier] intoWebView:self.webView withEndCode:@"</img>"];

(whereas f is an object that contains the name, identifier, etc. of that Signature8 field).
The problem is: this doesn’t work. When I debug through it, I can see innerhtml filled, I can see that newCode is actually correct (to me at least) and I thought that the line that assigns outerHTML with newCode and all that should replace the whole HTML accordingly. To verify, I logged it out to the console. Yeah.. nothing changed at all.

Can anyone tell me what I’m doing wrong here? I cannot use jQuery or any other framework really, as the code should get its HTML forms from third parties and they do not have to use jQuery or anything like that.

  • 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-04T17:39:33+00:00Added an answer on June 4, 2026 at 5:39 pm

    Well unfortunately not, but I found a solution with a proxy that can modify the HTML on the fly before I get it. Works as well 🙂

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

Sidebar

Related Questions

Let's say we have this code: <form action='' method='POST' enctype='multipart/form-data'> <input type='file' name='userFile'><br> <input
Let’s say I have a number like 0x448 . In binary this is 0100
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
Let's say I have table with column 'URL' whrere I store urls like this
Let's say that I have a set of relations that looks like this: relations
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I have some json like this in mongo: {n:5} and a java
Let's say I have this HTML: <div> <div class=ClassA></div> <div class=ClassX></div> <div class=ClassB></div> <div
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I can call a method like this: core::get() . What is the

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.