Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
webview_flutter - Javascript event works on browser but not on app webview

I'm using the official "webview_flutter" plugin, and I want to modify a form that will be sent to a server. This is the code that I have in my flutter app to programmatically modify form values: (It modifies the value but it sends an empty form to the server)

void _setFormLocationHistory() async {
sleep(Duration(seconds: 1));

await _webViewcontroller.runJavascriptReturningResult(
    'var event = new Event("change", {bubbles: true,});var this_input = document.getElementsByName("/awLRwRXn4GTpdcq3aJE2WQ/Location_History")[0];this_input.value = "test";this_input.dispatchEvent(event);');
print("Location History updated in webview.");
  }

This is the form that I want to fill programmatically (both from a browser view and from the app view): enter image description here

However, if I copy and paste the same exact code on my browser console (from pc instead of app), then it gets sent to server correctly. I want the app to work the same way the pc-browser works.

enter image description here This is the results that I receive in the server. From the app I get an empty string while from browser I get "test2"

enter image description here

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!