Skip to content

Best way to use HTML form to take user input instead of window.prompt #7932

@DragonOsman

Description

@DragonOsman

I want to know the best way to use an HTML form to take user input, in Emscripten-generated JavaScript code, instead of the window.prompt method. I tried to doing it, but it didn't work. I couldn't get the program to take the input. I tried submitting to the WASM file with the POST method (action="index.wasm" and method="post") but that also didn't work.

The C++ code is the same as in this thread, but I had emcc generate HTML and just made changes to it (I only kept the textarea element in the HTML file and then changed the prompt in the window.prompt method to what it is in the C++ code, in this case "Enter price (0:100): ") instead of doing it like I described in that thread again. So I don't have those console errors. But I do want to know how to use an HTML form instead of window.prompt to take user input in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions