Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda