1

I have an app that has a web-view which has a basic web-form that has a few fields and a submit button. I would like to figure out in my app if the form has any input in any of the fields. I cannot change the form from the server side, and I can't be certain much about the fields (ids / names in the html).

In iOS we accomplish this with an interesting process of pulling all the html out when loading the form, and comparing it to the html at any given point, if they don't match, the user must have entered something into a field. I believe we were able to get the html by injecting and running some javascript into the web-view. I'm not sure exactly how to approach the problem on android, or if android has any better tools to get whether a form has been edited.

Anybody have any ideas / pseudo-code how I can tell if a form has had input in any of the fields in a webview in android?

Kevin DiTraglia
  • 25,746
  • 19
  • 92
  • 138

1 Answers1

1

Unfortunately, there are no special form-related tools in Android WebView either. You can use the same approach as you have described for iOS.

A couple of links to get you started:

Community
  • 1
  • 1
Mikhail Naganov
  • 6,643
  • 1
  • 26
  • 26
  • Yeah this is pretty much what I ended up doing. I did have an extra tool I wasn't aware of at the time, there is guaranteed to be a check_if_modified javascript function on the form I am able to call. Thanks for the answer. – Kevin DiTraglia May 12 '15 at 11:08