Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can get the coordinates for the input field using javascript on the webView. Then, place your own textField right on top of it and in it's delegate method textFieldShouldReturn send a request to the server with the code the user typed in.</p> <pre><code> //Get text field coordinate from webview. - You should do this after the webview gets loaded //myCustomDiv is a div in the html that contains the textField. int textFieldContainerHeightOutput = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"myCustomDiv\").offsetHeight;"] intValue]; int textFieldContainerWidthOutput = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"myCustomDiv\").offsetWidth;"] intValue]; int textFieldContainerYOffset = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"myCustomDiv\").offsetTop;"] intValue]; int textFieldContainerXOffset = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"myCustomDiv\").offsetLeft;"] intValue]; myTextField.frame = CGRectMake(textFieldContainerXOffset, textFieldContainerYOffset, textFieldContainerWidthOutput, textFieldContainerHeightOutput); [webView addSubview:myTextField]; myTextField.delegate = self; </code></pre> <p>Then you implement textFieldShouldReturn and create your request to the server there. </p> <pre><code>-(BOOL)textFieldShouldReturn:(UITextField *)textField { //here you create your request to the server return NO; } </code></pre> <p>This is done in existing project, however without using PhoneGap. I hope you can adapt it to suit your needs.</p> <p>To remove the text field, you can hide it</p> <pre><code>myTextField.hidden = YES; </code></pre> <p>or</p> <pre><code>myTextField = nil; </code></pre> <p>or</p> <pre><code>[myTextField removeFromSuperView]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload