Harlowe has no built-in support for allowing a player to enter information into text input field and unfortunately the csalzman's text input hack mentioned in this comment on the old forum no longer works with recent version of Harlowe 2. This story format also has no documented Javascript API so there is no official way to use Javascript to update a Harlowe 2 story variable using Javascript.
You could try using the (prompt:) macro.
Greyelf is right, (prompt:) is the way to go.
(set: $name to (prompt: "Your name is...", "Casper the friendly ghost"))
Did you check this video by Dan Cox?
https://www.youtube.com/watch?v=MvMmcccZytY
He mentions the (prompt: ) macro but also modal windows. Maybe it can be useful.