How we can send the data submited by webpage form to godot html5 game?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By soeng kanel

Hi Community,

I have a webpage contains a form with username & password field , the webpage is running in Django web-framework.
and assume , I will have a html5 game which is export from godot game engine.

In godot, does it possible to submit the data from webpage and send this submit data to html5 game? any tutorial or guideline . please help to share.

the flow like this:

website (form) ->submit form → game (html5 exported by godot engine)

:bust_in_silhouette: Reply From: Matt Greer

Your Godot HTML5 game can invoke JavaScript with JavaScript.eval(), here is a tutorial on it:

If your form can set its data on the window, then you could do from within Godot:

var username = JavaScript.eval("window.username")

But for that to work, your form needs to stick its data onto the window with JavaScript. Since HTML forms can be done in many different ways, it’s hard to offer more help.